chore(stack): fix shellcheck warnings for safe argument handling

In stack.sh line 9:
ARGS="$@"
     ^--^ SC2124 (warning): Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.


In stack.sh line 36:
  "$ACTION" $ARGS
            ^---^ SC2086 (info): Double quote to prevent globbing and word splitting.

In stack.sh line 42:
  "$ACTION" $ARGS
            ^---^ SC2086 (info): Double quote to prevent globbing and word splitting.
This commit is contained in:
Digikwal 2025-06-24 18:48:32 +02:00 committed by GitHub
parent 90bcb0291a
commit 5275cb8695
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,7 +6,7 @@ set -e
ACTION="$1" ACTION="$1"
shift shift
ARGS="$@" ARGS=("$@")
if [ "$ACTION" != "up" ] && [ "$ACTION" != "down" ]; then if [ "$ACTION" != "up" ] && [ "$ACTION" != "down" ]; then
echo "Usage: $0 up|down [extra docker compose flags]" 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 \ # --env-file /home/frappe/gitops/traefik.env \
# -f overrides/compose.traefik.yaml \ # -f overrides/compose.traefik.yaml \
# -f overrides/compose.traefik-ssl.yaml \ # -f overrides/compose.traefik-ssl.yaml \
# "$ACTION" $ARGS # "$ACTION" "${ARGS[@]}"
# Uncomment this block when using mariadb container by frappe # Uncomment this block when using mariadb container by frappe
echo "==> MariaDB $ACTION $ARGS" echo "==> MariaDB $ACTION $ARGS"
@ -33,10 +33,10 @@ docker compose \
--project-name mariadb \ --project-name mariadb \
--env-file /home/frappe/gitops/mariadb.env \ --env-file /home/frappe/gitops/mariadb.env \
-f overrides/compose.mariadb-shared.yaml \ -f overrides/compose.mariadb-shared.yaml \
"$ACTION" $ARGS "$ACTION" "${ARGS[@]}"
echo "==> ERPNext $ACTION $ARGS" echo "==> ERPNext $ACTION $ARGS"
docker compose \ docker compose \
--project-name erpnext-one \ --project-name erpnext-one \
-f /home/frappe/gitops/erpnext-one.yaml \ -f /home/frappe/gitops/erpnext-one.yaml \
"$ACTION" $ARGS "$ACTION" "${ARGS[@]}"