From 43e7672725232f8de37e86e2be13feeb9613f9a7 Mon Sep 17 00:00:00 2001 From: 3wc <3wc.git@doesthisthing.work> Date: Sun, 24 Jan 2021 16:57:23 +0200 Subject: [PATCH] Prevent accidental `cd` when loading app vars --- abra | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/abra b/abra index c11ff0b..ecf268b 100755 --- a/abra +++ b/abra @@ -367,7 +367,7 @@ require_app_latest() { fi if [ "$abra___skip_update" = "false" ]; then - cd "$APP_DIR" && git pull > /dev/null 2>&1 + (cd "$APP_DIR" && git pull > /dev/null 2>&1) fi } @@ -773,9 +773,9 @@ sub_app_deploy (){ APP=$(basename "$APP_DIR") ( - cd "$APP_DIR" || error "\$APP_DIR '$APP_DIR' not found" + (cd "$APP_DIR" || error "\$APP_DIR '$APP_DIR' not found") # shellcheck disable=SC2086 - if docker stack deploy -c ${COMPOSE_FILE//:/ -c } "$STACK_NAME"; then + if (cd "$APP_DIR" && docker stack deploy -c ${COMPOSE_FILE//:/ -c } "$STACK_NAME"); then if [ -n "$DOMAIN" ]; then success "Yay! App should be available at https://${DOMAIN}" else