From 8ebd75be8fd1fd3375393742eb5ea5d6ed7dea22 Mon Sep 17 00:00:00 2001 From: ache Date: Thu, 16 Nov 2017 21:46:40 +0100 Subject: Todo fix --- functions/fish_prompt.fish | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'functions') diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index 180359d..b66528a 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -129,13 +129,15 @@ function prompt_shlv -d "Display level shell" end function prompt_todo -d "Display todo" - set all (todo | wc -l) - set chkd (todo checked | wc -l) - set td (math "$all-$chkd") + if which todo ^ /dev/null > /dev/null + set all (todo | wc -l) + set chkd (todo checked | wc -l) + set td (math "$all-$chkd") - if [ $all -gt 0 ] - prompt_segment 5C5C5C blue "$td/$all" - end + if [ $all -gt 0 ] + prompt_segment 5C5C5C blue "$td/$all" + end + end end -- cgit v1.2.3-54-g00ecf