From 349b468140c55d5d9e7b65cb409d80cb9b7988d3 Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Sat, 10 Jul 2021 02:36:01 +0200 Subject: [PATCH] Revert "Override ARGS and fail correctly" This reverts commit b2e0a95a111ebe24e890993fb6fd64221afd2192. --- abra | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/abra b/abra index e61bd33..df39902 100755 --- a/abra +++ b/abra @@ -1846,12 +1846,10 @@ sub_app_run(){ RUN_USER="-u $abra___user" fi - local -a ARGS="${ARGS:-""}" - if [ "$abra___no_tty" = "true" ]; then - ARGS+=" -i" + ARGS="-i" else - ARGS+=" -it" + ARGS="-it" fi CONTAINER=$(docker container ls --format "table {{.ID}},{{.Names}}" \ @@ -1863,14 +1861,11 @@ sub_app_run(){ fi debug "Using container ID ${CONTAINER}" - # shellcheck disable=SC2145 - debug "Running command: docker exec $RUN_USER $ARGS $CONTAINER $@" - exit + # 3wc: we want the "splitting" that shellcheck warns us about, so that -u and + # $RUN_USER aren't treated as a single argument: # shellcheck disable=SC2086 - if ! docker exec $RUN_USER $ARGS "$CONTAINER" "$@"; then - exit 1 - fi + docker exec $RUN_USER $ARGS "$CONTAINER" "$@" return }