From 4cfcbd3f435f114b8d29f1bf6d50a0378dd7c028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Tue, 15 Jun 2010 02:58:13 +0200 Subject: added some games; added templates; added debug; moved functions to functions.sh --- functions.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 functions.sh (limited to 'functions.sh') diff --git a/functions.sh b/functions.sh new file mode 100644 index 0000000..e943dca --- /dev/null +++ b/functions.sh @@ -0,0 +1,43 @@ +out () { + echo ">>> $@" +} + +log () { + [[ $PLAY_DEBUG > 0 ]] && echo "*** $@" +} + +exp () { + log "Setting envvar '$1' to '$2'" + export $1=$2 +} + +exc () { + cmd="eval" + + if [[ $1 == "-e" ]]; then + cmd="exec" + shift + fi + + if [[ $PLAY_DEBUG > 0 ]]; then + log "Executing (using '$cmd'):" + log "> $@" + + sleep 3 + fi + + $cmd "$@" +} + +EXPORT () { + local name=$1 + shift + + for f in $@; do + eval "$f () { ${name}_${f}; }" + done +} + +inherit () { + source $PLAY_TEMPLATES/$1 +} -- cgit v1.2.3