From 9dfcc83f52869903aecba6bbf7394be7b5b4d441 Mon Sep 17 00:00:00 2001 From: Antoine Stevan <44101798+amtoine@users.noreply.github.com> Date: Fri, 12 Apr 2024 18:35:25 +0200 Subject: [PATCH] make sure Git does not give an error in the prompt (#192) when not in a Git repo and using Nushell 0.92.0, this previous `do` block would print "not in a Git repo" on each prompt update... --- .../nu-git-manager-sugar/git/lib/prompt.nu | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/nu-git-manager-sugar/nu-git-manager-sugar/git/lib/prompt.nu b/pkgs/nu-git-manager-sugar/nu-git-manager-sugar/git/lib/prompt.nu index 181d4b0..1f519ec 100644 --- a/pkgs/nu-git-manager-sugar/nu-git-manager-sugar/git/lib/prompt.nu +++ b/pkgs/nu-git-manager-sugar/nu-git-manager-sugar/git/lib/prompt.nu @@ -4,7 +4,10 @@ use style.nu [color, simplify-path] # /!\ the PWD will be sanitized export def get-left-prompt [duration_threshold: duration]: nothing -> string { let is_git_repo = not ( - do --ignore-errors { ^git rev-parse --is-inside-work-tree } | is-empty + do --ignore-errors { ^git rev-parse --is-inside-work-tree } + | complete + | get stdout + | is-empty ) # FIXME: use `path sanitize` from `nu-git-manager`