Skip to content

Commit

Permalink
make sure Git does not give an error in the prompt (#192)
Browse files Browse the repository at this point in the history
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...
  • Loading branch information
amtoine authored Apr 12, 2024
1 parent c44b7c2 commit 9dfcc83
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit 9dfcc83

Please sign in to comment.