Fix bug on getting version number on go segment

It is common for users to have grep aliased to `grep --colour='always`.
This fix sets grep on getting the go version to `never`.
This commit is contained in:
Caio Gondim
2015-09-30 00:22:05 +02:00
parent e79f9ff10c
commit ccadea1dd4

View File

@@ -381,7 +381,7 @@ prompt_go() {
setopt extended_glob setopt extended_glob
if [[ (-f *.go(#qN) || -d Godeps || -f glide.yaml) ]]; then if [[ (-f *.go(#qN) || -d Godeps || -f glide.yaml) ]]; then
if command -v go > /dev/null 2>&1; then if command -v go > /dev/null 2>&1; then
prompt_segment $BULLETTRAIN_GO_BG $BULLETTRAIN_GO_FG $BULLETTRAIN_GO_PREFIX" $(go version | grep -oE 'go[[:digit:]].[[:digit:]]')" prompt_segment $BULLETTRAIN_GO_BG $BULLETTRAIN_GO_FG $BULLETTRAIN_GO_PREFIX" $(go version | grep --colour=never -oE '[[:digit:]].[[:digit:]]')"
fi fi
fi fi
} }