From acea6f0edfac8205cedcbac763454cd62df340ea Mon Sep 17 00:00:00 2001 From: Digikwal <79085106+digikwal@users.noreply.github.com> Date: Tue, 24 Jun 2025 19:04:28 +0200 Subject: [PATCH] fix: make script POSIX-compliant for broader shell compatibility Refactored to use strictly POSIX-compliant syntax. - Replaced array assignment `ARGS=("$@")` with `ARGS="$*"` for ash compatibility (e.g. Alpine) - Removed array-specific expansions like `${ARGS[@]}` - Preserved full functionality for Docker Compose execution - Ensured the script passes linting tools like shfmt and shellcheck This ensures the script runs reliably in both Alpine (ash) and Ubuntu (bash) environments. --- stack.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stack.sh b/stack.sh index 94ac5ae3..9fd07e23 100755 --- a/stack.sh +++ b/stack.sh @@ -6,7 +6,7 @@ set -e ACTION="$1" shift -ARGS=("$@") +ARGS="$*" if [ "$ACTION" != "up" ] && [ "$ACTION" != "down" ]; then echo "Usage: $0 up|down [extra docker compose flags]" @@ -25,7 +25,7 @@ cd /home/frappe/frappe_docker || { # --env-file /home/frappe/gitops/traefik.env \ # -f overrides/compose.traefik.yaml \ # -f overrides/compose.traefik-ssl.yaml \ -# "$ACTION" "${ARGS[@]}" +# $ACTION $ARGS # Uncomment this block when using mariadb container by frappe echo "==> MariaDB $ACTION $ARGS" @@ -33,10 +33,10 @@ docker compose \ --project-name mariadb \ --env-file /home/frappe/gitops/mariadb.env \ -f overrides/compose.mariadb-shared.yaml \ - "$ACTION" "${ARGS[@]}" + $ACTION $ARGS echo "==> ERPNext $ACTION $ARGS" docker compose \ --project-name erpnext-one \ -f /home/frappe/gitops/erpnext-one.yaml \ - "$ACTION" "${ARGS[@]}" + $ACTION $ARGS