From 21d8fc63780f6046267ef9d4c1df46de2eac9913 Mon Sep 17 00:00:00 2001 From: Jason Hutchinson Date: Wed, 12 Apr 2017 17:09:23 -0500 Subject: [PATCH] Redirect stderr for GOPATH check to /dev/null Accounts for instances where `go` binary is not installed. --- powerlevel9k.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 09ce6b3d..73dedcf6 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -746,7 +746,7 @@ 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) + go_path=$(go env GOPATH 2>/dev/null) if [[ -n "$go_version" && "${PWD##$go_path}" != "$PWD" ]]; then "$1_prompt_segment" "$0" "$2" "green" "255" "$go_version"