Last active
August 29, 2015 14:24
-
-
Save sarathsp06/30710cfa1749eaf7c4f8 to your computer and use it in GitHub Desktop.
Golang - go get initializer tool gor private repositories in bitbucket
This file contains hidden or 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 -o errexit | |
set -o pipefail | |
set -o nounset | |
args=("${@}") | |
package="${args[0]}" | |
echo -n "Enter your bitbucket username " | |
read user_name | |
if [ ! -d $GOPATH/src/${package} ];then | |
bitbucketUrl="https://${user_name}@${package}.git" | |
git clone $bitbucketUrl $GOPATH/src/${package} | |
fi | |
go get ${package} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage
This will clone the repository into $GOPATH/src and do go get on the same again , this step is necessary only once then always one can use go get on the package for updates and so on