diff options
| author | Hugo Hromic <hhromic@users.noreply.github.com> | 2019-02-18 12:54:15 +0000 |
|---|---|---|
| committer | XECDesign <XECDesign@users.noreply.github.com> | 2019-02-18 12:54:15 +0000 |
| commit | 564f8ef1b87399c0d4b798baf83f9d2b95ac77b7 (patch) | |
| tree | 5a05c7d3b76868c80f11d647e8f68a18730335e4 /build.sh | |
| parent | 7068086c94a5c048aad19c412e31a3a56a5c8b78 (diff) | |
Silence shellcheck warnings (#255)
* Made more specific shellcheck disables
* Fixed variable quoting (SC2086,SC2064)
* Use `$*` expansion instead of `$@` when not using arrays (SC2124)
* Use cleaner `$()` syntax instead of back quotes (SC2006)
* Improved comparator (SC2166)
* Minor improvements in coding style
Tested clean output using: `find -name "*.sh" | xargs -n1 shellcheck -x`.
Diffstat (limited to 'build.sh')
| -rwxr-xr-x | build.sh | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -1,5 +1,5 @@ #!/bin/bash -e -# shellcheck disable=SC2119,SC1091 +# shellcheck disable=SC2119 run_sub_stage() { log "Begin ${SUB_STAGE_DIR}" @@ -102,7 +102,7 @@ run_stage(){ ./prerun.sh log "End ${STAGE_DIR}/prerun.sh" fi - for SUB_STAGE_DIR in ${STAGE_DIR}/*; do + for SUB_STAGE_DIR in "${STAGE_DIR}"/*; do if [ -d "${SUB_STAGE_DIR}" ] && [ ! -f "${SUB_STAGE_DIR}/SKIP" ]; then run_sub_stage @@ -124,6 +124,7 @@ fi if [ -f config ]; then + # shellcheck disable=SC1091 source config fi @@ -132,8 +133,11 @@ do case "$flag" in c) EXTRA_CONFIG="$OPTARG" + # shellcheck disable=SC1090 source "$EXTRA_CONFIG" ;; + *) + ;; esac done @@ -206,8 +210,8 @@ log "Begin ${BASE_DIR}" STAGE_LIST=${STAGE_LIST:-${BASE_DIR}/stage*} -for STAGE_DIR_ in $STAGE_LIST; do - STAGE_DIR=`realpath "${STAGE_DIR_}"` +for STAGE_DIR in $STAGE_LIST; do + STAGE_DIR=$(realpath "${STAGE_DIR}") run_stage done |
