enable shellcheck
Fix shellcheck issues in gen_makefile and enable.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I24e6290c21cd6afd02385609d96e93522fd53380
diff --git a/.shellcheck b/.shellcheck
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/.shellcheck
diff --git a/gen_makefile.sh b/gen_makefile.sh
index 8960183..d1aaf66 100755
--- a/gen_makefile.sh
+++ b/gen_makefile.sh
@@ -2,6 +2,7 @@
files=()
dir=$1 #Base directory
+# shellcheck disable=SC2206 # $2 is purposefully wordsplit.
types=($2) #List of types (convert to array)
echo "openpower_procedures_cpp_files = \\"
@@ -9,13 +10,13 @@
do
type=${types[$i]}
type=${type// /} #remove spaces
- for file in $(ls $dir/procedures/$type/*.cpp);
+ for file in "$dir"/procedures/"$type"/*.cpp;
do
- files+=($file)
+ files+=("$file")
done
done
-for file in ${files[@]};
+for file in "${files[@]}";
do
echo " $file \\"
done