You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(scripts): abort deploy when compose_file_args reports a missing file (#7862)
compose_file_args() exits 1 on a missing compose file, but all 4 callers
consumed it via `mapfile -t compose_args < <(compose_file_args)`. The
process substitution runs the function in a subshell, so its exit 1 only
kills that subshell; mapfile itself returns 0, so set -e never fires and
the caller kept going -- invoking `docker compose` with an empty or
truncated -f set instead of aborting on a stale/mistyped compose path.
Consume it via a checked command-substitution assignment
(`if ! compose_args_raw="$(compose_file_args)"; then exit 1; fi`) at all 4
call sites, then split into the array with a here-string. This propagates
the real exit code (including the truncated-partial-output case) regardless
of set -e. compose_file_args's own logic is unchanged.
Adds compose_file_args exit-propagation tests to
selfhost-deploy-common.test.ts: happy path continues, a missing sole file
aborts before the consumer, and a later missing file aborts instead of
continuing with a truncated arg list.
Closes#7765
Co-authored-by: jaytbarimbao-collab <300663773+jaytbarimbao-collab@users.noreply.github.com>
0 commit comments