From 8100fab05d12d56c8204b467f4b68811b8c0c796 Mon Sep 17 00:00:00 2001 From: Philipp Daniels Date: Sun, 9 Oct 2016 01:57:54 +0200 Subject: [PATCH] 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. --- launcher | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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" -- 2.25.1