diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-12-11 14:52:11 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-12-11 14:52:11 +1300 |
commit | 6e8c6c521ae5d60427634be01b82fe61a79f192b (patch) | |
tree | 5349fc3e9838c69dbb6fd69f0234ea921ea446ea /sh/profile.d/welcome.sh | |
parent | Factor out zsh ENV hack into one file (diff) | |
download | dotfiles-6e8c6c521ae5d60427634be01b82fe61a79f192b.tar.gz dotfiles-6e8c6c521ae5d60427634be01b82fe61a79f192b.zip |
Refactor some conditionals
Diffstat (limited to 'sh/profile.d/welcome.sh')
-rw-r--r-- | sh/profile.d/welcome.sh | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sh/profile.d/welcome.sh b/sh/profile.d/welcome.sh index ede7a05f..cdd41edb 100644 --- a/sh/profile.d/welcome.sh +++ b/sh/profile.d/welcome.sh @@ -20,8 +20,10 @@ esac # Show a fortune if welcome fortune ; then - [ -d "$HOME"/.local/share/games/fortunes ] && - : "${FORTUNE_PATH:="$HOME"/.local/share/games/fortunes}" + if ! [ -n "$FORTUNE_PATH"] && + [ -d "$HOME"/.local/share/games/fortunes ] ; then + FORTUNE_PATH=$HOME/.local/share/games/fortunes + fi fortune -s "$FORTUNE_PATH" printf '\n' fi @@ -34,7 +36,9 @@ esac # Run verse(1) if we haven't seen it already today if welcome verse ; then - [ -f "$HOME"/.verse ] && read -r last <"$HOME"/.verse + if [ -f "$HOME"/.verse ] ; then + read -r last <"$HOME"/.verse + fi now=$(date +%Y%m%d) if [ "$now" -gt "${last:-0}" ] ; then verse |