fix script

This commit is contained in:
yuli
2024-08-05 16:48:38 +03:00
parent 98b719adab
commit 0f2c80a82e

View File

@@ -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