From 5c853a35aeb63bf7daeea08bbd9fb6dd7190ade8 Mon Sep 17 00:00:00 2001 From: Antoine Vaure Date: Mon, 21 Oct 2024 01:01:32 +0200 Subject: [PATCH] check if direnv exists in fish's prompt (fix error message when it is not available) --- fish.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fish.nix b/fish.nix index adc23f5..6186012 100644 --- a/fish.nix +++ b/fish.nix @@ -67,7 +67,9 @@ set -l prompt_status (__fish_print_pipestatus "[" "]" "|" "$status_color" "$statusb_color" $last_pipestatus) # direnv status - set -l direnv_status (direnv status | grep -q "Found RC path" && echo " direnv") + if which direnv >/dev/null + set -l direnv_status (direnv status | grep -q "Found RC path" && echo " direnv") + end # echo -n -s (prompt_login)' ' (set_color $color_cwd) (prompt_pwd) $normal (fish_vcs_prompt) \ echo -n -s (set_color $color_cwd) (prompt_pwd) $normal (fish_vcs_prompt) \