Fix shellcheck errors in scripts 13/64913/1
authorEric Ball <eball@linuxfoundation.org>
Tue, 4 Aug 2020 19:25:53 +0000 (12:25 -0700)
committerEric Ball <eball@linuxfoundation.org>
Tue, 4 Aug 2020 19:25:53 +0000 (12:25 -0700)
Change-Id: I8ffc8ac98bc128f54aa515153615c8aa10560316
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
ensure-documented.sh
releasenotes/notes/fix-shellcheck-errors-9aa83f7c21d16ee9.yaml [new file with mode: 0644]
shell/jjb-verify-job.sh
shell/license-check.sh

index b24e40c..823a542 100755 (executable)
@@ -35,7 +35,7 @@ for file in "${jjb_files[@]}"; do
     done
 done
 
-if [ $undocumented_count -gt 0 ]; then
+if [ "$undocumented_count" -gt 0 ]; then
     echo "Number of undocumented items: $undocumented_count"
     exit 1
 fi
diff --git a/releasenotes/notes/fix-shellcheck-errors-9aa83f7c21d16ee9.yaml b/releasenotes/notes/fix-shellcheck-errors-9aa83f7c21d16ee9.yaml
new file mode 100644 (file)
index 0000000..a458ef1
--- /dev/null
@@ -0,0 +1,4 @@
+---
+fixes:
+  - |
+    Minor fixes to correct shellcheck warnings/errors.
index 5ed12e2..7d679bd 100644 (file)
@@ -29,10 +29,10 @@ set +f
 # Directories beginning with {0..9} or {A..Z} are left at the top level.
 (   cd archives/job-configs
     for letter in {a..z}; do
-        if ls -d $letter* > /dev/null 2>&1; then
+        if ls -d "$letter"* > /dev/null 2>&1; then
             mkdir .tmp
-            mv $letter* .tmp
-            mv .tmp $letter
+            mv "$letter"* .tmp
+            mv .tmp "$letter"
         fi
     done
 )
index 8466cf9..5b43072 100644 (file)
@@ -56,7 +56,7 @@ fi
 set -f  # Disable globbing for $file_patterns to pass '*'
 # Purposely disable SC2068 for $file_patterns
 # shellcheck disable=SC2068
-lhc --license "$licenses_allowed" ${disable_spdx} \
+lhc --license "$licenses_allowed" "${disable_spdx}" \
     --exclude "$license_exclude_paths" \
     ${file_patterns[@]}
 set +f