Skip to content

exec-env improvements #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ checksum verified
By default we try to verify the checksum of each install but ocassionally [that's not possible](https://github.com/kennyp/asdf-golang/issues/91).
If you need to skip the checksum for some reason just set `ASDF_GOLANG_SKIP_CHECKSUM`.

## `GOROOT` and `GOPATH` Overrides

By default, `$GOROOT` and `$GOPATH` are set to the selected version's
`.../go` and `.../packages` dirs, and unset if the selected version is
`system`. Set the `$ASDF_GOLANG_DISABLE_GOROOT` and/or
`$ASDF_GOLANG_DISABLE_GOPATH` environment variables to `1` to disable
this behavior for the respective variables.

## Contributing

Feel free to create an issue or pull request if you find a bug.
Expand Down
12 changes: 6 additions & 6 deletions bin/exec-env
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env bash

if [ "${ASDF_INSTALL_VERSION}" != 'system' ] ; then
if [[ "unset" == "${GOROOT:-unset}" ]] ; then
if [ "${ASDF_INSTALL_VERSION}" = 'system' ] ; then
[ "${ASDF_GOLANG_DISABLE_GOROOT-}" = '1' ] || unset -v GOROOT
[ "${ASDF_GOLANG_DISABLE_GOPATH-}" = '1' ] || unset -v GOPATH
else
[ "${ASDF_GOLANG_DISABLE_GOROOT-}" = '1' ] ||
export GOROOT=$ASDF_INSTALL_PATH/go
fi

if [[ "unset" == "${GOPATH:-unset}" ]] ; then
[ "${ASDF_GOLANG_DISABLE_GOPATH-}" = '1' ] ||
export GOPATH=$ASDF_INSTALL_PATH/packages
fi
fi