Advertisement
Guest User

Untitled

a guest
Oct 7th, 2015
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if [[ -z ${ORIGINALGOPATH+x} ]]
  4. then
  5. ORIGINALGOPATH="$GOPATH"
  6. ORIGINALPS1="$PS1"
  7. GOPATH="${PWD}/vendor:${PWD}:$ORIGINALGOPATH"
  8. PROJDIR="${PWD##*/}"
  9. PS1="${ORIGINALPS1}GO($PROJDIR)> "
  10. echo "Activating..."
  11. echo "GOPATH = $GOPATH"
  12.  
  13. deactivate() {
  14. export GOPATH="$ORIGINALGOPATH"
  15. export PS1="$ORIGINALPS1"
  16. echo "Deactivating..."
  17. echo "GOPATH = $GOPATH"
  18. unset -v ORIGINALGOPATH
  19. unset -v ORIGINALPS1
  20. unset -f deactivate
  21. }
  22. else
  23. echo "Already activated. You may deactivate"
  24. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement