Skip to content

Commit

Permalink
Fix for issue #101, switch back from master branch if building locally
Browse files Browse the repository at this point in the history
  • Loading branch information
sparrc committed Aug 11, 2015
1 parent 9f2e6d6 commit 374a0af
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,18 @@ do_build() {
for b in ${BINS[*]}; do
rm -f $GOPATH_INSTALL/bin/$b
done
# If the branch has an upstream, go get switches to master for some reason
# unsetting the upstream causes go get to stay on the current branch, but
# is admittedly a little annoying
git branch --unset-upstream
if [ $? == 0 ]; then
echo "WARNING: upstream branch unset for go get command to work"
fi
go get -u -f ./...
if [ $? -ne 0 ]; then
echo "WARNING: failed to 'go get' packages."
fi

go install -a -ldflags="-X main.Version $version -X main.Commit $commit" ./...
if [ $? -ne 0 ]; then
echo "Build failed, unable to create package -- aborting"
Expand Down

0 comments on commit 374a0af

Please sign in to comment.