Fix for issue #101, switch back from master branch if building locally
This commit is contained in:
parent
9f2e6d6172
commit
374a0af084
|
@ -167,10 +167,18 @@ do_build() {
|
||||||
for b in ${BINS[*]}; do
|
for b in ${BINS[*]}; do
|
||||||
rm -f $GOPATH_INSTALL/bin/$b
|
rm -f $GOPATH_INSTALL/bin/$b
|
||||||
done
|
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 ./...
|
go get -u -f ./...
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "WARNING: failed to 'go get' packages."
|
echo "WARNING: failed to 'go get' packages."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
go install -a -ldflags="-X main.Version $version -X main.Commit $commit" ./...
|
go install -a -ldflags="-X main.Version $version -X main.Commit $commit" ./...
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Build failed, unable to create package -- aborting"
|
echo "Build failed, unable to create package -- aborting"
|
||||||
|
|
Loading…
Reference in New Issue