summaryrefslogtreecommitdiff
path: root/play.sh
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2011-04-03 10:28:31 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2011-04-03 10:28:31 +0200
commitbae0b0a61c03e27838c8050e9e6a039a946ccaee (patch)
treee8bd6c2b5a9a4fdf17ae9faf8d4510802ef7fc39 /play.sh
parent9b57768aab4e54388382edddd763b4abd2c6a6ab (diff)
downloadplay-bae0b0a61c03e27838c8050e9e6a039a946ccaee.tar.gz
play-bae0b0a61c03e27838c8050e9e6a039a946ccaee.tar.bz2
play-bae0b0a61c03e27838c8050e9e6a039a946ccaee.zip
Fix variable passing
Diffstat (limited to 'play.sh')
-rwxr-xr-xplay.sh20
1 files changed, 12 insertions, 8 deletions
diff --git a/play.sh b/play.sh
index f1d86ba..f6e7517 100755
--- a/play.sh
+++ b/play.sh
@@ -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"