diff options
author | Ben Hilburn <bhilburn@gmail.com> | 2017-05-23 04:55:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-23 04:55:49 +0300 |
commit | b63bf001131a3fd295365f300d508ff2401fa9a7 (patch) | |
tree | 970667c55c41c7d4b7bd7b06243f69cc37f68c44 /powerlevel9k.zsh-theme | |
parent | 58d5027dba03410f6c24f8f1b54a5b1e8a3acb6a (diff) | |
parent | 55cf15ac41219e50d380adf9b5140b4cf9c259f5 (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-x | powerlevel9k.zsh-theme | 4 |
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 } |