mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-15 15:05:27 +08:00
fish_git_prompt: silence xcrun error when XCode is not installed
Our macOS workarounds involve running "xcrun" to check if Git is installed. On a freshly upgraded Ventura system that does not have XCode or CommandLineTools installed, "xcrun" will print this error: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun on every prompt. Let's silence this error. (cherry picked from commit a0840637fae7371d8492a86700fe6605cd998634)
This commit is contained in:
parent
c39c598996
commit
9bd6097fcb
@ -183,7 +183,7 @@ if string match -q Darwin -- "$(uname)" && type -q xcode-select && type -q xcrun
|
|||||||
command git --version &>/dev/null &
|
command git --version &>/dev/null &
|
||||||
disown $last_pid &>/dev/null
|
disown $last_pid &>/dev/null
|
||||||
function __fish_git_prompt_ready
|
function __fish_git_prompt_ready
|
||||||
path is "$(xcrun --show-cache-path)" || return 1
|
path is "$(xcrun --show-cache-path 2>/dev/null)" || return 1
|
||||||
# git is ready, erase the function.
|
# git is ready, erase the function.
|
||||||
functions -e __fish_git_prompt_ready
|
functions -e __fish_git_prompt_ready
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user