diff options
author | Caio Oliveira <caio.oliveira@intel.com> | 2023-05-27 07:57:29 -0700 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2023-05-30 18:53:26 -0700 |
commit | abb15b41ccd0b6491a84b8e1c8f4a75eccd71561 (patch) | |
tree | 05c027f8f4199a812a25f9b089563b5c5c6b7670 | |
parent | a9a7d9aad6d1d5d9adc9f5ff26191bd843f4d77e (diff) |
Fix exit code for successful executions
The conditional in one line (A && B && C) would always fail in the
case either A or B are not true, regardless our earlier build result.
Since this was the last part of the script, the result would be used
as exit code for nj.
Change the one line into an actual if-statement, and also ensure we
return early in case of the main build right above fails.
This makes possible running "git rebase --exec nj".
-rwxr-xr-x | nj | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -73,5 +73,8 @@ cd "$builddir" extratargets="$(cat extratargets 2>/dev/null)" targets="${@:-all $extratargets}" -ninja $targets -[[ "$targets" == all* ]] && [ -e install ] && ninja install > /dev/null +ninja $targets || exit 1 + +if [[ "$targets" == all* ]] && [ -e install ]; then + ninja install > /dev/null +fi |