From b6a4c14bedeab03c05650b2421e54e209e281dd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 23 Apr 2022 10:35:00 +0300 Subject: [PATCH] exec-env: unset GOROOT and GOPATH if version is system Otherwise they -- especially GOROOT -- may end up pointing to a completely wrong one. --- bin/exec-env | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/exec-env b/bin/exec-env index a363908..1efaf05 100755 --- a/bin/exec-env +++ b/bin/exec-env @@ -1,6 +1,8 @@ #!/usr/bin/env bash -if [ "${ASDF_INSTALL_VERSION}" != 'system' ] ; then +if [ "${ASDF_INSTALL_VERSION}" = 'system' ] ; then + unset -v GOROOT GOPATH +else if [[ "unset" == "${GOROOT:-unset}" ]] ; then export GOROOT=$ASDF_INSTALL_PATH/go fi