]> source.dussan.org Git - sonarqube.git/commitdiff
[script] use local variable rather than function arguments
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Mon, 23 May 2016 14:48:02 +0000 (16:48 +0200)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Mon, 23 May 2016 14:56:27 +0000 (16:56 +0200)
scripts/property_utils.sh

index a58fb22b64e8b32a9d9b25ef379cfa6010721896..3644fa992fa61877ada1bce54e0cf3a757a70b62 100755 (executable)
@@ -10,7 +10,7 @@ set -euo pipefail
 
 function cnt_lines() {
   FILE=$1
-  cat $1 | wc -l
+  cat $FILE | wc -l
 }
 
 function write_prop() {
@@ -46,11 +46,11 @@ function set_property() {
     NEW_LINE_COUNT=$(cnt_lines $FILE)
 
     if [[ $LINE_COUNT -gt $NEW_LINE_COUNT ]]; then
-      write_prop $1 $2 $3
+      write_prop $PROPERTY $VALUE $FILE
     fi
 
   else
-    write_prop $1 $2 $3
+    write_prop $PROPERTY $VALUE $FILE
   fi
 }