Skip to content

Commit

Permalink
[SCRIPTS] fix argument passing in property_utils.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
sns-seb committed Sep 22, 2017
1 parent 1f99769 commit 9304414
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/property_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

set -euo pipefail

function cnt_lines() {
function cnt_lines {
local FILE=$1
cat $FILE | wc -l
}

function write_prop() {
function write_prop {
local PROPERTY=$1
local VALUE=$2
local FILE=$3
Expand All @@ -25,7 +25,7 @@ function write_prop() {
echo "${PROPERTY}=${VALUE}" >> $FILE
}

function set_property() {
function set_property {
local PROPERTY=$1
local VALUE=$2
local FILE=$3
Expand All @@ -46,10 +46,10 @@ function set_property() {
local NEW_LINE_COUNT=$(cnt_lines $FILE)

if [[ $LINE_COUNT -gt $NEW_LINE_COUNT ]]; then
write_prop $PROPERTY $VALUE $FILE
write_prop "$PROPERTY" "$VALUE" "$FILE"
fi

else
write_prop $PROPERTY $VALUE $FILE
write_prop "$PROPERTY" "$VALUE" "$FILE"
fi
}

0 comments on commit 9304414

Please sign in to comment.