From: Philipp Daniels Date: Sat, 8 Oct 2016 23:57:54 +0000 (+0200) Subject: Fix empty arguments on launcher rerun after git pull X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8100fab05d12d56c8204b467f4b68811b8c0c796;p=discourse_docker.git Fix empty arguments on launcher rerun after git pull Variable $@ cannot be used to get arguments for launcher rerun, because the usage of the shift (line 44) command has removed all entries from $@. Instead $BASH_ARGV can be used, but $BASH_ARGV contains arguments in reversed order. --- diff --git a/launcher b/launcher index f65ff1b..b0e14d9 100755 --- a/launcher +++ b/launcher @@ -644,7 +644,12 @@ case "$command" in elif [ $LOCAL = $BASE ]; then echo "Updating Launcher" git pull || (echo 'failed to update' && exit 1) - exec /bin/bash $0 $@ + + for (( i=${#BASH_ARGV[@]}-1,j=0; i>=0,j<${#BASH_ARGV[@]}; i--,j++ )) + do + args[$j]=${BASH_ARGV[$i]} + done + exec /bin/bash $0 "${args[@]}" # $@ is empty, because of shift at the beginning. Use BASH_ARGV instead. elif [ $REMOTE = $BASE ]; then echo "Your version of Launcher is ahead of origin"