From a52068dec0f086766c85feacda7e5250ef861ed7 Mon Sep 17 00:00:00 2001 From: deajan Date: Mon, 20 May 2019 11:50:58 +0200 Subject: [PATCH] Fixed possible issues with spaces --- dev/bootstrap.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dev/bootstrap.sh b/dev/bootstrap.sh index 54773af..d6a8461 100755 --- a/dev/bootstrap.sh +++ b/dev/bootstrap.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -## dev pre-processor bootstrap rev 2018100201 +## dev pre-processor bootstrap rev 2019052001 ## Yeah !!! A really tech sounding name... In fact it's just include emulation in bash function Usage { @@ -19,16 +19,17 @@ if [ ! -f "./merge.sh" ]; then fi bootstrapProgram="" -opts="" +opts=() outputFileName="$0" -for i in "$@"; do - case $i in +for i in "${@}"; do + echo "-$i-" + case "$i" in --program=*) bootstrapProgram="${i##*=}" ;; *) - opts=$opts" $i" + opts+=("$i") ;; esac done @@ -69,7 +70,7 @@ if type termux-fix-shebang > /dev/null 2>&1; then fi if [ "$BASHVERBOSE" == "yes" ]; then - bash -x "$outputFileName.tmp.sh" $opts + bash -x "$outputFileName.tmp.sh" "${opts[@]}" else - "$outputFileName.tmp.sh" $opts + "$outputFileName.tmp.sh" "${opts[@]}" fi