This commit is contained in:
Advait Patel 2025-02-20 07:05:34 +00:00 committed by GitHub
commit c76ed4437a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,5 +1,11 @@
#!/bin/bash
# check if `go` is installed or not
if ! command -v go &> /dev/null; then
echo "Error: Go is not installed. Please install Go before running this script."
exit 1
fi
BINFILE=watchtower
if [ -n "$MSYSTEM" ]; then
BINFILE=watchtower.exe
@ -7,3 +13,10 @@ fi
VERSION=$(git describe --tags)
echo "Building $VERSION..."
go build -o $BINFILE -ldflags "-X github.com/containrrr/watchtower/internal/meta.Version=$VERSION"
if [ $? -ne 0 ]; then
echo "Error: Build failed!"
exit 1
fi
echo "Build successful!"