diff --git a/build.sh b/build.sh index 91dc861..ddb8dcf 100755 --- a/build.sh +++ b/build.sh @@ -1,24 +1,23 @@ -#!/bin/sh - -set -x +#!/bin/bash VERSION=$(cat ./version.txt) HASH=$(git rev-parse --short=12 HEAD) TIMESTAMP=$(date +%Y%m%d%H%M%S) # Current timestamp FULL_VERSION=$VERSION-$TIMESTAMP-$HASH -if [ -x "~/go/bin/packr" ]; then +if [ -x ~/go/bin/packr ]; then echo "Found ~/go/bin/packr" elif [ -x "packr" ]; then echo "Fond packr" else + echo "installing packr" go install github.com/gobuffalo/packr/packr@latest fi cd src go get -d -v -if [ -x "~/go/bin/packr" ]; then +if [ -x ~/go/bin/packr ]; then ~/go/bin/packr else packr @@ -26,7 +25,7 @@ fi CGO_ENABLED=0 go build -v -ldflags="-s -w -X main.version=$FULL_VERSION" -o ../databunker -if [ -x "~/go/bin/packr" ]; then +if [ -x ~/go/bin/packr ]; then ~/go/bin/packr clean else packr clean