aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2017-05-23 04:55:49 +0300
committerGitHub <noreply@github.com>2017-05-23 04:55:49 +0300
commitb63bf001131a3fd295365f300d508ff2401fa9a7 (patch)
tree970667c55c41c7d4b7bd7b06243f69cc37f68c44 /powerlevel9k.zsh-theme
parent58d5027dba03410f6c24f8f1b54a5b1e8a3acb6a (diff)
parent55cf15ac41219e50d380adf9b5140b4cf9c259f5 (diff)
Merge pull request #473 from zikes/patch-1
Only show go_version segment if inside GOPATH
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme4
1 files changed, 3 insertions, 1 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 45881876..7c7e2cfa 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -754,9 +754,11 @@ prompt_docker_machine() {
# GO prompt
prompt_go_version() {
local go_version
+ local go_path
go_version=$(go version 2>/dev/null | sed -E "s/.*(go[0-9.]*).*/\1/")
+ go_path=$(go env GOPATH 2>/dev/null)
- if [[ -n "$go_version" ]]; then
+ if [[ -n "$go_version" && "${PWD##$go_path}" != "$PWD" ]]; then
"$1_prompt_segment" "$0" "$2" "green" "255" "$go_version"
fi
}