Skip to content

Instantly share code, notes, and snippets.

@wndhydrnt
Created September 24, 2016 07:03
Show Gist options
  • Save wndhydrnt/f06dff8db2c6a37756648146acdf4049 to your computer and use it in GitHub Desktop.
Save wndhydrnt/f06dff8db2c6a37756648146acdf4049 to your computer and use it in GitHub Desktop.
Link a repository to your GOPATH
#!/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