fish: fix errors with prompt when cwd does not exist

This commit is contained in:
lelgenio 2022-06-02 15:24:02 -03:00
parent 6397ca360f
commit 1026262031
1 changed files with 6 additions and 1 deletions

View File

@ -51,7 +51,12 @@ function fish_git_prompt
command -qs git
or return
pushd (string replace -r '/\.git(/.*)?$' '' "$PWD")
set -l here (string replace -r '/\.git(/.*)?$' '' "$PWD")
test -d "$here"
or return
pushd "$here"
############################################################
# Check if in a git repo and save branch and status