From 18796cf4e225af0001f6eb1b33710efdbaee48ac Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Mon, 30 Oct 2023 20:43:15 -0400 Subject: [PATCH] shells/zsh: only print TODO if file is not empty --- users/modules/global/shells/zsh.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/users/modules/global/shells/zsh.nix b/users/modules/global/shells/zsh.nix index 4d38756..7feb9c4 100644 --- a/users/modules/global/shells/zsh.nix +++ b/users/modules/global/shells/zsh.nix @@ -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 }