diff mbox series

[oe-layersetup,PATCHv2,01/16] oe-layertool-setup: split logic and/or expressions

Message ID 20230614034507.598391-2-res.sapp@gmail.com
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series Sacrifice your first born to the linter | expand

Commit Message

Res Sapp June 14, 2023, 3:44 a.m. UTC
Shellcheck:
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.

Signed-off-by: Randolph Sapp <res.sapp@gmail.com>
---
 oe-layertool-setup.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/oe-layertool-setup.sh b/oe-layertool-setup.sh
index 1fca272..ef25ca0 100755
--- a/oe-layertool-setup.sh
+++ b/oe-layertool-setup.sh
@@ -126,7 +126,7 @@  exit 1
 
 check_input() {
     # Check that at least -i or -f was used
-    if [ "$interactive" = "n" -a "x$inputfile" = "x" ]
+    if [ "$interactive" = "n" ] && [ "x$inputfile" = "x" ]
     then
         echo "ERROR: You must either use this script with the -i or -f options"
         usage
@@ -1000,7 +1000,7 @@  fi
 if [ "x$interactive" = "xy" ]
 then
     cont="y"
-    while [ "x$cont" = "xy" -o "x$cont" = "xY" ]
+    while [ "x$cont" = "xy" ] || [ "x$cont" = "xY" ]
     do
         # clean up the variables for each repo
         name=""