Skip to content

Commit 760c1bd

Browse files
authored
Merge pull request #15 from buildkite-plugins/fix-bash-3.2-regression
Make option parsing work in bash 3.x
2 parents 2b9d7da + 0d75bf5 commit 760c1bd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hooks/command

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ if [[ -z ${files:-} ]] ; then
3535
fi
3636

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

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

0 commit comments

Comments
 (0)