File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ function plugin_read_list() {
2121
2222IFS=$' \n\t '
2323files=()
24- options=()
2524
2625# Evaluate all the globs and return the files that exist
2726for file in $( plugin_read_list FILES) ; do
@@ -30,16 +29,14 @@ for file in $(plugin_read_list FILES) ; do
3029 fi
3130done
3231
33- # Read in the options to pass to shellcheck
34- for option in $( plugin_read_list OPTIONS) ; do
35- options+=(" $option " )
36- done
37-
3832if [[ -z ${files:- } ]] ; then
3933 echo " No files found to shellcheck"
4034 exit 1
4135fi
4236
37+ # Read in the options to pass to shellcheck
38+ mapfile -t options<<< " $(plugin_read_list OPTIONS)"
39+
4340echo " +++ Running shellcheck on ${# files[@]} files"
4441if docker run --rm -v " $PWD :/mnt" --workdir " /mnt" koalaman/shellcheck " ${options[@]+${options[@]} } " " ${files[@]} " ; then
4542 echo " Files are ok ✅"
You can’t perform that action at this time.
0 commit comments