diff options
-rw-r--r-- | sh/profile.d/welcome.sh | 10 |
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 ) |