Skip to content

Commit 0f66d5b

Browse files
committed
fix(test): improve error logging for failed commands in no-fail-fast mode
Use `printf '%q'` with `"$@"` to preserve argument quoting and capture exit status into a variable for reliability. https://claude.ai/code/session_01VHRbHsz8VJFdNioSj6dyxe
1 parent 9791346 commit 0f66d5b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

test.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ run_if() (
3535
true)
3636
if [[ $no_fail_fast == 'true' ]]; then
3737
run "$@" || {
38-
echo "error: Command $* failed with exit code $?" >&2
38+
exit_status=$?
39+
printf 'error: Command failed with exit code %d: ' "$exit_status" >&2
40+
printf '%q ' "$@" >&2
41+
printf '\n' >&2
3942
touch "$failure_marker"
4043
}
4144
else

0 commit comments

Comments
 (0)