Mail-Graveyard/compile.sh
2026-07-05 22:30:32 +02:00

17 lines
731 B
Bash

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
# htmx ins dist holen (wird per //go:embed eingebacken)
mkdir -p frontend-js/dist
if command -v curl >/dev/null 2>&1 && [ ! -f frontend-js/dist/htmx.min.js ]; then
curl -fsSL https://unpkg.com/htmx.org@1.9.12/dist/htmx.min.js -o frontend-js/dist/htmx.min.js
fi
go mod tidy
# Statisches Binary. Der Umzug laeuft dort, wo Netz zu beiden Providern besteht
# (Workstation oder DietPi-NB) -> Linux + Windows bauen.
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags "-s -w" -o mail-graveyard .
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags "-s -w" -o mail-graveyard.exe .
echo "built ./mail-graveyard und ./mail-graveyard.exe"