From ce816e63ed07ba77a182017d85b8e7684dc36d3a Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sat, 20 Apr 2024 23:54:33 -0400 Subject: [PATCH] Fail gracefully when hg or fossil segments are enabled but the binaries aren't available. --- functions/fish_prompt.fish | 2 ++ 1 file changed, 2 insertions(+) diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index 03017d0..4cc6415 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -197,6 +197,7 @@ end function __bobthefish_fossil_project_dir -S -a real_pwd -d 'Print the current fossil project base directory' [ "$theme_display_fossil" = 'yes' ] + and command -q fossil and set -f dir (command fossil json status 2>/dev/null | grep localRoot | string split ':' -f2 | string trim --chars='"/,') or return @@ -209,6 +210,7 @@ end function __bobthefish_hg_project_dir -S -a real_pwd -d 'Print the current hg project base directory' [ "$theme_display_hg" = 'yes' ] + and command -q hg or return set -q theme_vcs_ignore_paths