#!/bin/bash set -euo pipefail # Find bun executable if command -v bun >/dev/null 2>&1; then BUN_CMD="bun" else BUN_CMD="$HOME/.bun/bin/bun" fi # Find go executable if command -v go >/dev/null 2>&1; then GO_CMD="go" else GO_CMD="/usr/local/go/bin/go" fi # Build frontend pushd frontend $BUN_CMD run build # Copy static assets mkdir -p build/css cp static/css/bulma.min.css build/css/ # Build backend (without CGO) popd echo "Building Go backend..." CGO_ENABLED=0 $GO_CMD build -v -o notes-app || { echo "Go build failed!" exit 1 } echo "Go build completed successfully."