From ed174d49aaef2c9640a8d513c905f962e09e91ed Mon Sep 17 00:00:00 2001 From: David Spickett Date: Wed, 20 May 2020 10:18:52 +0100 Subject: 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 --- jenkins-helpers.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'jenkins-helpers.sh') 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 -- cgit v1.2.3