Skip to content

Commit

Permalink
Avoid failure in command substitution
Browse files Browse the repository at this point in the history
  • Loading branch information
andreabedini committed Apr 29, 2024
1 parent 24a6b29 commit 31b8cc2
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions nix/workbench/wb
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,23 @@ start() {
progress "top-level | analysis" "analysis type $(with_color yellow "$analysis_type") on $(with_color white "$run")"

local runspec
runspec=$(test -n "$ident" && echo "$ident":)$run

analyse "${analyse_args[@]}" "$analysis_type" "$runspec" &&
progress "run | analysis" "done for $(white "$runspec")" ||
if test -n "$analysis_can_fail" -a -z "$no_retry_failed_runs"
then progress "run | analysis" "log processing failed, but --analysis-can-fail prevents failure: $(with_color red "$runspec")"
iterations=$((iterations + 1))
else fail "analysis failed: $run"
false; fi
if test -n "$ident"; then
runspec="$ident":$run
else
runspec=$run
fi

if analyse "${analyse_args[@]}" "$analysis_type" "$runspec"; then
progress "run | analysis" "done for $(white "$runspec")"
else
if test -n "$analysis_can_fail" -a -z "$no_retry_failed_runs"; then
progress "run | analysis" "log processing failed, but --analysis-can-fail prevents failure: $(with_color red "$runspec")"
iterations=$((iterations + 1))
else
fail "analysis failed: $run"
false
fi
fi
done

if test -z "$no_analysis" -a "$analysis_type" != null -a "$iterations" -gt 1
Expand Down

0 comments on commit 31b8cc2

Please sign in to comment.