From 38b93488e56b7df3e1bb987eaed191f7c48ed64e Mon Sep 17 00:00:00 2001 From: demize Date: Sat, 20 Apr 2024 23:01:06 -0400 Subject: [PATCH] Avoid a redundant call to `fossil` --- functions/fish_prompt.fish | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index fab1b59..03017d0 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -197,14 +197,13 @@ end function __bobthefish_fossil_project_dir -S -a real_pwd -d 'Print the current fossil project base directory' [ "$theme_display_fossil" = 'yes' ] - and command fossil json status >/dev/null 2>/dev/null + and set -f dir (command fossil json status 2>/dev/null | grep localRoot | string split ':' -f2 | string trim --chars='"/,') or return set -q theme_vcs_ignore_paths and [ (__bobthefish_ignore_vcs_dir $real_pwd) ] and return - set -f dir (command fossil json status 2>/dev/null | grep localRoot | string split ':' -f2 | string trim --chars='"/,') echo "/$dir" end