Change case of 'maven_options' 84/61984/7
authorTim Johnson <tijohnson@linuxfoundation.org>
Mon, 14 Oct 2019 16:27:23 +0000 (09:27 -0700)
committerTim Johnson <tijohnson@linuxfoundation.org>
Wed, 16 Oct 2019 14:07:16 +0000 (07:07 -0700)
Shellcheck will check for 'used-before-set' only if variable is
lower-case.

Change-Id: I5c91d493a584d332cc587be37d53b3c98e5dbb3a
Signed-off-by: Tim Johnson <tijohnson@linuxfoundation.org>
jenkins-init-scripts/lf-env.sh
releasenotes/notes/update-lf-bash-library-3a19064371ef7fca.yaml [new file with mode: 0644]

index 68e6cf0..252328f 100644 (file)
@@ -66,15 +66,14 @@ function lf-activate()
 # Functions that assign Variables
 ################################################################################
 
-# Although these variables are 'shell' variables, they need to be upper-case so
-# 'shellcheck' does check for 'used-before-set' when they are referenced. So if
-# forget to 'source' this file, you will get a 'run-time' error (if you have -u
-# set), otherwise you will get "MAVEN_OPIONS=''.
+# These variables are shell (local) variables and need to be lower-case so
+# Shellcheck knows they are shell variables and will check for
+# 'used-before-set'.
 
 function lf-set-maven-options()
 {
     # shellcheck disable=SC2034  # Disable 'unused-variable' check
-    MAVEN_OPTIONS=$(echo --show-version --batch-mode -Djenkins \
+    maven_options="--show-version --batch-mode -Djenkins \
         -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
-        -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)
+        -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r"
 }
diff --git a/releasenotes/notes/update-lf-bash-library-3a19064371ef7fca.yaml b/releasenotes/notes/update-lf-bash-library-3a19064371ef7fca.yaml
new file mode 100644 (file)
index 0000000..57662a3
--- /dev/null
@@ -0,0 +1,5 @@
+---
+fixes:
+  - |
+    Update to lf-env.sh. Change lf-set-maven-options(): MAVEN_OPTIONS to
+    maven_options to better support shellcheck.