Skip to content

Commit c091e06

Browse files
Fix: Check for presence of go files
Previously, the script only checked for a single .go file using the -f *.go(#qN) condition, resulting in a false negative when multiple .go files were present. This has been fixed by using an array to capture all matching .go files and checking the length of the array.
1 parent d60f62c commit c091e06

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bullet-train.zsh-theme

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,9 @@ prompt_perl() {
543543
# Go
544544
prompt_go() {
545545
setopt extended_glob
546-
if [[ (-f *.go(#qN) || -d Godeps || -f glide.yaml) ]]; then
546+
go_files=( *.go(#qN) )
547+
548+
if [[ ($#go_files -gt 0 || -d Godeps || -f glide.yaml) ]]; then
547549
if command -v go > /dev/null 2>&1; then
548550
prompt_segment $BULLETTRAIN_GO_BG $BULLETTRAIN_GO_FG $BULLETTRAIN_GO_PREFIX" $(go version | grep --colour=never -oE '[[:digit:]].[[:digit:]]+')"
549551
fi

0 commit comments

Comments
 (0)