diff options
author | David Spickett <david.spickett@linaro.org> | 2020-04-06 16:56:01 +0100 |
---|---|---|
committer | David Spickett <david.spickett@linaro.org> | 2020-04-15 10:19:04 +0000 |
commit | 9870685df5ce0e2690f0632d50acb05393e13b7c (patch) | |
tree | 01297b06019ef254d5b2ebd64b10fc65bf049abc /sanity-check.sh | |
parent | a52f4b1f30483527a71c803f6540ab33485ca299 (diff) |
sanity-check.sh: Allow local users
to check individual scripts
Change-Id: I4982aa64b7324351493f36a23a5916710e20ae12
Diffstat (limited to 'sanity-check.sh')
-rwxr-xr-x | sanity-check.sh | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sanity-check.sh b/sanity-check.sh index bfbd5d51..1a3da79c 100755 --- a/sanity-check.sh +++ b/sanity-check.sh @@ -1,5 +1,17 @@ #!/bin/bash -set -eu -o pipefail +set -euf -o pipefail + +# Usage: +# Check all scripts in this folder: +# ./sanity-check.sh +# Check specific files: +# ./sanity-check.sh script1.sh script2.sh + +if [[ "$#" -eq 0 ]]; then + files=($(find "$(dirname "$0")" -name "*.sh")) +else + files=("${@}") +fi #TODO: newer versions of shellcheck can set a minimum message level ignored=( @@ -18,4 +30,4 @@ ignored=( -e SC2031 # baseline_branch was modified in a subshell. That change might be lost. ) -shellcheck "$(dirname "$0")"/*.sh "${ignored[@]}" +shellcheck "${files[@]}" "${ignored[@]}" |