]> source.dussan.org Git - sonarqube.git/commitdiff
[scripts] don't use pattern matching operator unless needed
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Wed, 30 May 2018 14:06:56 +0000 (16:06 +0200)
committerSonarTech <sonartech@sonarsource.com>
Tue, 12 Jun 2018 18:21:01 +0000 (20:21 +0200)
scripts/editions.sh
scripts/logs.sh
scripts/stop.sh

index 238b4837e2fcb6101413c638f223b468f51be86f..fadf5cbe03ac318f9e53bf40d360ef65d1c9f6f5 100755 (executable)
@@ -13,12 +13,12 @@ function checkEditionArgument() {
   local editionArg="$1"
   local lowerEditionArg=$(toLower $editionArg)
 
-  if [ "$lowerEditionArg" == "$DEFAULT_EDITION" ]; then
+  if [ "$lowerEditionArg" = "$DEFAULT_EDITION" ]; then
     return
   fi
 
   for t in $EDITIONS; do
-    if [ "$lowerEditionArg" == "$t" ]; then
+    if [ "$lowerEditionArg" = "$t" ]; then
       return
     fi
   done
index 90e64b3f1750f3c6f24cd00c98f4815389167570..e023847fb8b879c7f8e57e541f9e7fc39b2d1cec 100755 (executable)
@@ -31,12 +31,12 @@ function checkLogArgument() {
   local logArg="$1"
   local lowerLogArg=$(toLower $logArg)
 
-  if [ "$lowerLogArg" == "$DEFAULT_LOG" ]; then
+  if [ "$lowerLogArg" = "$DEFAULT_LOG" ]; then
     return
   fi
 
   for t in $LOGS; do
-    if [ "$lowerLogArg" == "$t" ]; then
+    if [ "$lowerLogArg" = "$t" ]; then
       return
     fi
   done
@@ -51,7 +51,7 @@ function buildTailArgs() {
   local res=""
 
   for t in $LOGS; do
-    if [ "$logArg" == "$DEFAULT_LOG" ] || [ "$logArg" == "$t" ]; then
+    if [ "$logArg" = "$DEFAULT_LOG" ] || [ "$logArg" = "$t" ]; then
       res="$res -Fn $logLines $SQ_HOME/logs/$t.log"
     fi
   done
@@ -68,7 +68,7 @@ function doTail() {
 
 # check the script was called to avoid execute when script is only sourced
 script_name=$(basename "$0")
-if [ "$script_name" == "logs.sh" ]; then
+if [ "$script_name" = "logs.sh" ]; then
   LOG="$DEFAULT_LOG"
   LINES="$DEFAULT_LINES"
   EDITION="$DEFAULT_EDITION"
index c0dd72d8dbb16a16e91ae420a535c4c47d5d065a..8b94cd2d2a7cb2e5a7fc874ef7051968933c5d10 100755 (executable)
@@ -29,6 +29,6 @@ function stopAny() {
 
 # check the script was called to avoid execute when script is only sourced
 script_name=$(basename "$0")
-if [ "$script_name" == "stop.sh" ]; then
+if [ "$script_name" = "stop.sh" ]; then
   stopAny
 fi