diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2020-05-18 23:11:54 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2020-05-18 23:11:54 +1200 |
commit | b39c6f9a595bf1ea40fe7ceafb3658528a9265b9 (patch) | |
tree | 70af41d3b3cf20b51e851f9ee03b77c82fe9e09d /games/xyzzy.sh | |
parent | Merge branch 'release/v9.1.0' (diff) | |
parent | Bump VERSION (diff) | |
download | dotfiles-9.2.0.tar.gz (sig) dotfiles-9.2.0.zip |
Merge branch 'release/v9.2.0'v9.2.0
* release/v9.2.0:
Install bin/han as part of Bash target
Clean up xyzzy(6df) a bit
Apply XDG to xyzzy(6df)
Move wget config into XDG
Save wget HSTS cache in XDG_CACHE_HOME
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 |