shells/zsh: only print TODO if file is not empty

This commit is contained in:
Infinidoge 2023-10-30 20:43:15 -04:00
parent 5a1d0ab3ca
commit 18796cf4e2

View file

@ -25,10 +25,12 @@
precmd() {
precmd_any_nix_shell
if [[ -e ~/TODO.txt && ! -v __TODO_PRINTED ]] then
if [[ -s ~/TODO.txt && ! -v __TODO_PRINTED ]] then
export __TODO_PRINTED=1
echo TODO:
\cat ~/TODO.txt
if [[ "$(cat ~/TODO.txt)" != "" ]] then
echo TODO:
\cat ~/TODO.txt
fi
fi
}