Skip to content

Instantly share code, notes, and snippets.

@xiongchiamiov
Forked from rahulg/activate
Last active January 30, 2017 17:32
Show Gist options
  • Save xiongchiamiov/9861109 to your computer and use it in GitHub Desktop.
Save xiongchiamiov/9861109 to your computer and use it in GitHub Desktop.
export GOPATH="$(builtin cd "$(dirname "${BASH_SOURCE[0]:-$_}" )" && pwd)"
export OLDPS1=$PS1
export PS1="[go:$(basename $GOPATH)] $PS1"
alias gcd="cd $GOPATH"
deactivate() {
export PS1=$OLDPS1
unset GOPATH
unset OLDPS1
unalias gcd
unset deactivate
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment