diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2011-04-03 10:28:31 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2011-04-03 10:28:31 +0200 |
commit | bae0b0a61c03e27838c8050e9e6a039a946ccaee (patch) | |
tree | e8bd6c2b5a9a4fdf17ae9faf8d4510802ef7fc39 /play.sh | |
parent | 9b57768aab4e54388382edddd763b4abd2c6a6ab (diff) | |
download | play-bae0b0a61c03e27838c8050e9e6a039a946ccaee.tar.gz play-bae0b0a61c03e27838c8050e9e6a039a946ccaee.tar.bz2 play-bae0b0a61c03e27838c8050e9e6a039a946ccaee.zip |
Fix variable passing
Diffstat (limited to '')
-rwxr-xr-x | play.sh | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -15,15 +15,15 @@ BIN=$0 # global functions {{{ out () { - echo ">>> $@" >&2 + echo ">>> $*" >&2 } log () { - [[ $PLAY_DEBUG > 0 ]] && echo "*** $@" >&2 + [[ $PLAY_DEBUG > 0 ]] && echo "*** $*" >&2 } die () { - out "*** ERROR: $@" + out "*** ERROR: $*" exit 1 } @@ -33,7 +33,7 @@ exp () { } exc () { - cmd="eval" + local cmd="eval" if [[ $1 == "-e" ]]; then cmd="exec" @@ -41,9 +41,13 @@ exc () { fi log "Executing (using '$cmd'):" - log "> $@" + log "> $*" - $cmd "$@" + if [[ $cmd == exec ]]; then + exec $@ + else + $* + fi } EXPORT () { @@ -109,8 +113,8 @@ play_setenv () { play_run () { # cd into dir - local dir=$(exc winepath -u "$GPATH") - exc cd $(dirname $dir) + local dir="$(exc winepath -u $GPATH)" + exc cd "$(dirname $dir)" # start game exc wine start $GPATH "$ARGS" |