Skip to content

Instantly share code, notes, and snippets.

@bpollack
Created October 28, 2013 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bpollack/7197532 to your computer and use it in GitHub Desktop.
Save bpollack/7197532 to your computer and use it in GitHub Desktop.
setgopath for fish shell
function setgopath -d "Set the GOPATH to the current directory, and add its /bin to the PATH"
if [ -n "$GOPATH" ]
for x in (seq (count $PATH))
if [ $PATH[$x] = "$GOPATH/bin" ]
set clear $x $clear
end
end
for x in $clear
set -e PATH[$x]
end
end
set -gx GOPATH (pwd)
set -x PATH $GOPATH/bin $PATH
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment