aboutsummaryrefslogtreecommitdiff
path: root/sh/profile.d/welcome.sh
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2020-06-23 23:00:32 +1200
committerTom Ryder <tom@sanctum.geek.nz>2020-06-23 23:00:32 +1200
commite87cd78c261ec318f48102cff313a25d15533dd0 (patch)
tree6949f2e58fd2f8ec4b6919eb1566fb80e5acaefd /sh/profile.d/welcome.sh
parent626bf0c1fd06769b3d7425016b9c667d0ece9df5 (diff)
downloaddotfiles-e87cd78c261ec318f48102cff313a25d15533dd0.tar.gz
dotfiles-e87cd78c261ec318f48102cff313a25d15533dd0.zip
Use better location for verse cache
Diffstat (limited to 'sh/profile.d/welcome.sh')
-rw-r--r--sh/profile.d/welcome.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/sh/profile.d/welcome.sh b/sh/profile.d/welcome.sh
index 22914fa5..19231c2e 100644
--- a/sh/profile.d/welcome.sh
+++ b/sh/profile.d/welcome.sh
@@ -38,16 +38,16 @@ esac
# Run verse(1) if we haven't seen it already today
if welcome verse ; then
- cache=${XDG_CACHE_HOME:-$HOME/.cache}/verse
- mkdir -p -- "$cache"
- if [ -f "$cache"/last ] ; then
- read -r last <"$cache"/last
+ cache=${XDG_CACHE_HOME:-$HOME/.cache}/welcome
+ mkdir -p -- "$cache" || return
+ if [ -f "$cache"/verse ] ; then
+ read -r last <"$cache"/verse
fi
now=$(date +%Y%m%d)
if [ "$now" -gt "${last:-0}" ] ; then
verse
printf '\n'
- printf '%s\n' "$now" >"$cache"/last
+ printf '%s\n' "$now" >"$cache"/verse
fi
fi
)