Skip to content

Commit 51e92b6

Browse files
it's fixed but I broke tests
1 parent 4a63126 commit 51e92b6

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

libexec/goenv-version-name

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ fi
2424

2525
version_exists() {
2626
local input_version="$1"
27-
local use_go_mod="$2"
2827

29-
if [[ -n $use_go_mod ]] && [[ -d ${GOENV_ROOT}/versions ]] && grep -q -E "^[0-9]+\.[0-9]+\.?[0-9]*(\s*)$" <<<${input_version}; then
28+
if [[ -d ${GOENV_ROOT}/versions ]] && grep -q -E "^[0-9]+\.[0-9]+\.?[0-9]*(\s*)$" <<<${input_version}; then
3029
OLDIFS="$IFS"
3130
IFS=$'\n'
3231
local version_regex=$(echo ${input_version} | sed s/\\./\\\\./)
@@ -58,7 +57,7 @@ OLDIFS="$IFS"
5857
elif version_exists "${version#go-}"; then
5958
versions=("${versions[@]}" "${version#go-}")
6059
else
61-
if [[ -z $GOENV_GOMOD_VERSION_ENABLE ]] || ! version_exists "$version" "$GOENV_GOMOD_VERSION_ENABLE"; then
60+
if [[ -z $GOENV_GOMOD_VERSION_ENABLE ]] || ! version_exists "$version"; then
6261
echo "goenv: version '$version' is not installed (set by $(goenv-version-origin))" >&2
6362
any_not_installed=1
6463
fi

libexec/goenv-which

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,8 @@ done
6161

6262
version_exists() {
6363
local input_version="$1"
64-
local use_go_mod="$2"
6564

66-
if [[ -n $use_go_mod ]] && [[ -d ${GOENV_ROOT}/versions ]] && grep -q -E "^[0-9]+\.[0-9]+(\s*)$" <<<${input_version}; then
65+
if [[ -d ${GOENV_ROOT}/versions ]] && grep -q -E "^[0-9]+\.[0-9]+(\s*)$" <<<${input_version}; then
6766
OLDIFS="$IFS"
6867
IFS=$'\n'
6968
local version_regex=$(echo ${input_version} | sed s/\\./\\\\./)
@@ -91,12 +90,15 @@ if [ -x "$GOENV_COMMAND_PATH" ]; then
9190
exit 0
9291
fi
9392

93+
echo "goenv: You asshole"
94+
9495
any_not_installed=0
9596
for version in "${versions[@]}"; do
9697
if [ "$version" = "system" ]; then
9798
continue
9899
fi
99-
if ! version_exists "$version" "$GOENV_GO_MOD_ENABLE"; then
100+
101+
if ! version_exists "$version"; then
100102
echo "goenv: version '$version' is not installed (set by $(goenv-version-origin))" >&2
101103
any_not_installed=1
102104
fi

0 commit comments

Comments
 (0)