diff --git a/libexec/goenv-version-file-read b/libexec/goenv-version-file-read index 94059662..bd0ec1ba 100755 --- a/libexec/goenv-version-file-read +++ b/libexec/goenv-version-file-read @@ -13,7 +13,8 @@ fi # NOTE: Read the first non-whitespace word from the specified version file. # Be careful not to load it whole in case there's something crazy in it. IFS="${IFS}"$'\r' -words=($(cut -b 1-1024 "$VERSION_FILE" | sed 's/^\s*\(\S\+\).*/\1/')) +words=($(cut -b 1-1024 "$VERSION_FILE" | sed -n 's/^[[:space:]]*\([^[:space:]#][^[:space:]]*\).*/\1/p')) + versions=("${words[@]}") if [ ! -n "$versions" ]; then