From 5867fde9920cc4b38e0ab0d92d5943aa43e105f1 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Mon, 17 Nov 2014 20:17:49 -0800 Subject: [PATCH] [bobthefish] Don't break when hg/git not found --- fish_prompt.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fish_prompt.fish b/fish_prompt.fish index 85bbaf1..76a88e0 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -68,11 +68,11 @@ set __bobthefish_lt_blue 326D9E # =========================== function __bobthefish_in_git -d 'Check whether pwd is inside a git repo' - command git rev-parse --is-inside-work-tree >/dev/null 2>&1 + command which git > /dev/null 2>&1; and command git rev-parse --is-inside-work-tree >/dev/null 2>&1 end function __bobthefish_in_hg -d 'Check whether pwd is inside a hg repo' - command hg root > /dev/null 2>&1 + command which hg > /dev/null 2>&1; and command hg stat > /dev/null 2>&1 end function __bobthefish_git_branch -d 'Get the current git branch (or commitish)'