diff options
Diffstat (limited to 'games/xyzzy.sh')
-rw-r--r-- | games/xyzzy.sh | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/games/xyzzy.sh b/games/xyzzy.sh index 5cc03278..ebf3959a 100644 --- a/games/xyzzy.sh +++ b/games/xyzzy.sh @@ -1,6 +1,11 @@ # ADVENTURE -if [ -e "$HOME"/.xyzzy ] ; then - printf >&2 '%s\n' 'Nothing happens.' - exit 1 +dir=${XDG_CONFIG_HOME:-$HOME/.config}/xyzzy +if ! [ -d "$dir" ] ; then + mkdir -- "$dir" || exit fi -printf '%s\n' 'I see no cave here.' > "$HOME"/.xyzzy +if [ -e "$dir"/dest ] ; then + printf >&2 'Nothing happens.\n' +else + printf 'I see no cave here.\n' > "$dir"/dest +fi +exit 1 |