diff options
author | David Spickett <david.spickett@linaro.org> | 2020-05-20 10:18:52 +0100 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2020-05-20 11:07:20 +0000 |
commit | ed174d49aaef2c9640a8d513c905f962e09e91ed (patch) | |
tree | ef0bffc58b1e57ade2aa6fc612639f0009c74fef | |
parent | 11d21148f879ca003b574c3b12ae534508f4887c (diff) |
jenkins-helpers.sh: Fix run_step starting step logic
This if was originally written with -o -a but
changed to || and && to fix shellcheck warning:
https://github.com/koalaman/shellcheck/wiki/SC2166
Now we find out why shellcheck warns about that
because the replacement expression was incorrect
despite looking the same.
This:
X -o Y -a Z
Was converted to:
X || Y && Z
Which does:
(X || Y) && Z
But the orignal behaviour is:
X || (Y && Z)
Change-Id: I0bebd9c008e605953c0af8d26df15d811816ff14
-rw-r--r-- | jenkins-helpers.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh index e2f5a8d8..3ad79dda 100644 --- a/jenkins-helpers.sh +++ b/jenkins-helpers.sh @@ -1229,9 +1229,13 @@ run_step () run_step_count=$(($run_step_count+1)) + # Start running steps if: + # the current step is the starting step OR + # we haven't run any steps yet and + # there is no set starting step if [ x"$pretty_step" = x"$run_step_start_at" ] || \ - [ x"$run_step_start_at" = x"" ] && \ - [ x"$run_step_prev_step" = x"" ]; then + ( [ x"$run_step_start_at" = x"" ] && \ + [ x"$run_step_prev_step" = x"" ] ); then run_step_active=true fi |