verstak-desktop/scripts/build.sh

62 lines
1.3 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
FAILED=0
report() {
if [ "$2" -eq 0 ]; then
echo "$1"
else
echo "$1"
FAILED=1
fi
}
echo "=== verstak-desktop build ==="
# ── Go backend ──
echo "[backend]"
(cd "$ROOT" && go vet ./...)
report "go vet" $?
(cd "$ROOT" && go build ./...)
report "go build" $?
if command -v go-test-summary &>/dev/null || go test -list . ./... &>/dev/null 2>&1; then
(cd "$ROOT" && go test -count=1 ./... 2>&1 || true)
report "go test" $?
else
echo " go test: no tests to run"
fi
# ── Wails ──
echo "[wails]"
if command -v wails &>/dev/null; then
(cd "$ROOT" && wails build -clean)
report "wails build" $?
else
echo " ❌ wails: command not found. Install with: go install github.com/wailsapp/wails/v2/cmd/wails@latest"
FAILED=1
fi
# ── Frontend ──
echo "[frontend]"
if [ -f "$ROOT/frontend/package.json" ]; then
(cd "$ROOT/frontend" && npm ci --no-audit --no-fund)
report "npm ci" $?
(cd "$ROOT/frontend" && npm run build)
report "frontend build" $?
else
echo " frontend/package.json not found — skipping"
fi
echo ""
if [ "$FAILED" -eq 0 ]; then
echo "✅ build passed"
else
echo "❌ build failed"
fi
exit "$FAILED"