Skip to content

Commit

Permalink
Merge pull request #15 from buildkite-plugins/fix-bash-3.2-regression
Browse files Browse the repository at this point in the history
Make option parsing work in bash 3.x
  • Loading branch information
lox authored Aug 21, 2018
2 parents 2b9d7da + 0d75bf5 commit 760c1bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hooks/command
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ if [[ -z ${files:-} ]] ; then
fi

# Read in the options to pass to shellcheck
mapfile -t options<<<"$(plugin_read_list OPTIONS)"
while IFS=$'\n' read -r option ; do
options+=("$option")
done < <(plugin_read_list OPTIONS)

echo "+++ Running shellcheck on ${#files[@]} files"
if docker run --rm -v "$PWD:/mnt" --workdir "/mnt" koalaman/shellcheck "${options[@]+${options[@]}}" "${files[@]}" ; then
Expand Down

0 comments on commit 760c1bd

Please sign in to comment.