|
|
@ -996,11 +996,14 @@ prompt_docker_machine() {
|
|
|
|
################################################################
|
|
|
|
################################################################
|
|
|
|
# GO prompt
|
|
|
|
# GO prompt
|
|
|
|
prompt_go_version() {
|
|
|
|
prompt_go_version() {
|
|
|
|
local go_version=$(go version 2>/dev/null | sed -E "s/.*(go[0-9.]*).*/\1/")
|
|
|
|
_p9k_cached_cmd_stdout go version || return
|
|
|
|
local go_path=$(go env GOPATH 2>/dev/null)
|
|
|
|
emulate -L zsh && setopt extendedglob
|
|
|
|
if [[ -n "$go_version" && "${PWD##$go_path}" != "$PWD" ]]; then
|
|
|
|
local -a match
|
|
|
|
"$1_prompt_segment" "$0" "$2" "green" "grey93" "GO_ICON" 0 '' "${go_version//\%/%%}"
|
|
|
|
[[ $_P9K_RETVAL == (#b)*(go[0-9.]##)* ]] || return
|
|
|
|
fi
|
|
|
|
local v=$match[1]
|
|
|
|
|
|
|
|
local p=${GOPATH:-$(go env GOPATH 2>/dev/null)}
|
|
|
|
|
|
|
|
[[ -n $p && $PWD/ == $p/* ]] || return
|
|
|
|
|
|
|
|
"$1_prompt_segment" "$0" "$2" "green" "grey93" "GO_ICON" 0 '' "${v//\%/%%}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
################################################################
|
|
|
|
################################################################
|
|
|
|