17 lines
731 B
Bash
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 emailforwarder .
|
|
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags "-s -w" -o emailforwarder.exe .
|
|
echo "built ./emailforwarder und ./emailforwarder.exe"
|