diff --git a/manage.sh b/manage.sh index dcf8f2c..b899e65 100755 --- a/manage.sh +++ b/manage.sh @@ -9,11 +9,6 @@ CONFIG_FILE="${STACKS_CONFIG:-$STACKS_DIR/manage.conf}" LOCK_FILE="${STACKS_LOCK_FILE:-/run/lock/stacks-manage.lock}" DEFAULT_MAX_PARALLEL=2 -OUTPUT_IS_TTY=0 - -if [[ -t 1 && -z "${NO_COLOR+x}" ]]; then - OUTPUT_IS_TTY=1 -fi CONFIG_GROUP_NAMES=() CONFIG_GROUP_LIMITS=() @@ -260,15 +255,10 @@ stack_group() { compose() { local stack="$1" shift - local -a docker_args=(compose) - - if [[ "${STACKS_FORCE_ANSI:-0}" == "1" ]]; then - docker_args+=(--ansi always) - fi ( cd -- "$STACKS_DIR/$stack" || exit 1 - docker "${docker_args[@]}" "$@" + docker compose "$@" ) } @@ -298,21 +288,6 @@ run_stack() { esac } -run_stack_prefixed() { - local stack="$1" - local action="$2" - local line status - - STACKS_FORCE_ANSI="$OUTPUT_IS_TTY" run_stack "$stack" "$action" 0 2>&1 | - while IFS= read -r line || [[ -n "$line" ]]; do - [[ -n "$line" ]] || continue - printf '[%s] %s\n' "$stack" "$line" - done - status="${PIPESTATUS[0]}" - - return "$status" -} - run_group() { local group_index="$1" local action="$2" @@ -356,7 +331,7 @@ run_group() { ( status=0 - run_stack_prefixed "$stack" "$action" || status=$? + run_stack "$stack" "$action" 0 || status=$? printf '\n' >&"$semaphore_fd" exit "$status" ) &