Skip to content

Commit 0d75bf5

Browse files
committed
Make option parsing work in bash 3.x
1 parent 2b9d7da commit 0d75bf5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

hooks/command

Lines changed: 3 additions & 1 deletion
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)