diff options
author | David Spickett <david.spickett@linaro.org> | 2020-04-20 15:43:57 +0100 |
---|---|---|
committer | David Spickett <david.spickett@linaro.org> | 2020-04-20 16:58:38 +0100 |
commit | b9ecc76e09e95cd3132f1eef572279c1cec68218 (patch) | |
tree | 926c2b2d6d411ad266f70ee2756083bbbe07c05c /jenkins-helpers.sh | |
parent | 5bc4a8aa4bb4ec6ffc77d0acce0e3370582760d6 (diff) |
Shellcheck warning fixes
(all error/style level warnings)
SC1035: missing whitespace
SC2068: double quote array expansions
SC2145: argument mixes string and array
SC1066: Don't use $ on the left side of assignments
SC2126: Use grep -c instead of grep|wc
Change-Id: Ia53070d3e2c9aea9f626fdb7b2b5bfc9e1f8e682
Diffstat (limited to 'jenkins-helpers.sh')
-rw-r--r-- | jenkins-helpers.sh | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh index aea10d88..3c0bd7a0 100644 --- a/jenkins-helpers.sh +++ b/jenkins-helpers.sh @@ -271,7 +271,7 @@ remote_exec () # E.g., when triggering jobs via jenkins-cli, the command is not a binary, # so we can't "exec" it. # We use flock if $JENKINS_FLOCK is set. - ${JENKINS_FLOCK+$JENKINS_FLOCK} ssh $opts ${port:+-p$port} $host "${env_vars:+export $env_vars && }${dir:+cd "$(printf '%q' "$dir")" && exec }${cmd[@]}" + ${JENKINS_FLOCK+$JENKINS_FLOCK} ssh $opts ${port:+-p$port} $host "${env_vars:+export $env_vars && }${dir:+cd "$(printf '%q' "$dir")" && exec }${cmd[*]}" ) } @@ -874,9 +874,9 @@ convert_args_to_variables () ;; "--"*) name="${1#--}" - declare -g $name="$2" + declare -g "$name=$2" cat <<EOF | manifest_out -declare -g $name="$2" +declare -g "$name=$2" EOF num=2 ;; @@ -1220,15 +1220,15 @@ run_step () case "$run_step_status:$run_mode" in 0:*) ;; *:stop_on_fail) - echo "STOPPING before ${step[@]} due to previous failure" + echo "STOPPING before ${step[*]} due to previous failure" false ;; *:skip_on_fail) - echo "SKIPPING ${step[@]} due to previous failure" + echo "SKIPPING ${step[*]} due to previous failure" skip=true ;; *:reset_on_fail) - echo "HANDLING previous failure in ${step[@]}" + echo "HANDLING previous failure in ${step[*]}" ;; *) assert false @@ -1240,26 +1240,26 @@ run_step () rm -rf "$run_step_artifacts" mkdir -p "$run_step_artifacts" - echo "RUNNING ${step[@]}; see tail -f $run_step_artifacts/console.log" + echo "RUNNING ${step[*]}; see tail -f $run_step_artifacts/console.log" run_step_status=0 - eval "if $run_step_verbose; then set -x; else set +x; fi; ${step[@]}" 2>&1 | ts -s "%T" | tee -a $run_step_top_artifacts/console.log > $run_step_artifacts/console.log & + eval "if $run_step_verbose; then set -x; else set +x; fi; ${step[*]}" 2>&1 | ts -s "%T" | tee -a $run_step_top_artifacts/console.log > $run_step_artifacts/console.log & wait $! || run_step_status=$? case "$run_step_status:$run_mode" in 0:*) ;; *:stop_on_fail|*:reset_on_fail) - echo "STOPPING at ${step[@]} due to failure" + echo "STOPPING at ${step[*]} due to failure" false ;; *:skip_on_fail) - echo "CARRYING ON after failure in ${step[@]}" + echo "CARRYING ON after failure in ${step[*]}" ;; *) assert false esac fi else - echo "SKIPPING ${step[@]}" + echo "SKIPPING ${step[*]}" fi if [ x"$run_step_status" = x"0" -a x"$success_result" != x"x" ]; then |