Created
July 29, 2015 18:54
-
-
Save saml/32416edc86d2861e0db1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [[ -z ${ORIGINALGOPATH+x} ]] | |
| then | |
| ORIGINALGOPATH="$GOPATH" | |
| GOPATH="$(pwd):$ORIGINALGOPATH" | |
| echo "Activating..." | |
| echo "GOPATH = $GOPATH" | |
| deactivate() { | |
| export GOPATH="$ORIGINALGOPATH" | |
| echo "Deactivating..." | |
| echo "GOPATH = $GOPATH" | |
| unset -v ORIGINALGOPATH | |
| unset -f deactivate | |
| } | |
| else | |
| echo "Already activated. You may deactivate" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment