summaryrefslogtreecommitdiff
path: root/play.sh
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2012-09-09 15:26:45 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2012-09-09 15:26:45 +0200
commit0b333d107e68f7116833987afa98e8b4d0742d10 (patch)
treefeafb994a7470068501a122d7fef097ae2c2ae18 /play.sh
parent3711b89a3f6dae6e0c07eeb7e4b4696313255c1e (diff)
downloadplay-0b333d107e68f7116833987afa98e8b4d0742d10.tar.gz
play-0b333d107e68f7116833987afa98e8b4d0742d10.tar.bz2
play-0b333d107e68f7116833987afa98e8b4d0742d10.zip
Zsh Enhancements
Diffstat (limited to 'play.sh')
-rwxr-xr-xplay.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/play.sh b/play.sh
index dd0dc0c..41840be 100755
--- a/play.sh
+++ b/play.sh
@@ -10,9 +10,9 @@ PLAY_GAMES="${PLAY_GAMES:-$PLAY_DIR/installed}"
PLAY_TEMPLATES="${PLAY_TEMPLATES:-$PLAY_DIR/templates}"
typeset -A ENV EENV
-BIN=$0
+BIN=${0:A}
-PLAY_BIN=${PLAY_BIN:-$BIN}
+PLAY_BIN=${PLAY_BIN:-$0}
# }}}
# global functions {{{
@@ -140,10 +140,10 @@ play_setenv () {
play_run () {
# cd into dir
local dir="$(exc winepath -u $GPATH)"
- exc cd "$(dirname $dir)"
+ exc cd "${dir:h}"
# start game
- exc wine start $GPATH "$ARGS"
+ exc wine start ${dir:t} "$ARGS"
# wait for wine to shutdown
exc wineserver -w
@@ -157,7 +157,11 @@ EXPORT play execute prepare setenv run cleanup
_list () {
out "The installed games are:"
- for k in $PLAY_GAMES/*(.,@:t); do
+ # on -> sort alphabetically
+ # N -> NULL_GLOB -> no error message if no match
+ # .,@ -> regular files or symbolic links (, == or)
+ # :t -> modifier: only basename
+ for k in $PLAY_GAMES/*(onN.,@:t); do
echo "\t> $k"
done
}