From 118704ae789b52053f049fc649d7674f627d9867 Mon Sep 17 00:00:00 2001
From: root <root@flipper.fritz.box>
Date: Sat, 24 Jul 2021 23:12:48 +0200
Subject: [PATCH] Add todo prompt only, if calendar dir exists

---
 zshrc | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/zshrc b/zshrc
index bbdb8d2..22b413a 100644
--- a/zshrc
+++ b/zshrc
@@ -81,8 +81,10 @@ fi
 
 exists thefuck && eval $(thefuck --alias)
 
-_prompt_todos() {
-    local todos=$(rg -l '^STATUS:NEEDS-ACTION' $HOME/.calendars | wc -l)
-    [[ $todos -gt 0 ]] && echo "Todos: $todos"
-}
-__chromaz_extra_left+=_prompt_todos
+if [[ -e $HOME/.calendars ]]; then
+    _prompt_todos() {
+	local todos=$(rg -l '^STATUS:NEEDS-ACTION' $HOME/.calendars | wc -l)
+	[[ $todos -gt 0 ]] && echo "Todos: $todos"
+    }
+    __chromaz_extra_left+=_prompt_todos
+fi