Created
September 24, 2016 07:03
-
-
Save wndhydrnt/f06dff8db2c6a37756648146acdf4049 to your computer and use it in GitHub Desktop.
Link a repository to your GOPATH
This file contains 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
#!/usr/bin/env bash | |
set -e | |
hoster=${LN_GO_HOSTER:-github.com} | |
username=${LN_GO_USERNAME:-wndhydrnt} | |
if [ -z $1 ]; then | |
echo "" | |
echo "Usage: ln-go REPOSITORY [PATH]" | |
exit 1 | |
fi | |
if [ -z $2 ]; then | |
src_path=$PWD | |
else | |
src_path=$2 | |
fi | |
go_src_path=$GOPATH/src/$hoster/$username/$1 | |
echo "Linking $src_path to $go_src_path" | |
ln -s $src_path $go_src_path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment