Pulse/build.sh
Pulse Monitor 6ac6f62950 fix: permanently solve frontend embed sync issue
- Add build.sh script that ensures frontend is copied before Go build
- Update backend-watch.sh to sync frontend on every restart
- Remove duplicate frontend files from internal/api/
- Frontend embed directory already in .gitignore
- No more manual copying needed - just run ./build.sh
2025-08-12 20:56:43 +00:00

26 lines
No EOL
625 B
Bash
Executable file

#!/bin/bash
# Build script for Pulse that ensures frontend is in the right place for embedding
set -e
echo "Building Pulse..."
# Build frontend
echo "Building frontend..."
cd frontend-modern
npm run build
# Ensure the embed directory exists and is up to date
echo "Preparing frontend for embedding..."
mkdir -p ../internal/api/frontend-modern
rm -rf ../internal/api/frontend-modern/dist
cp -r dist ../internal/api/frontend-modern/
# Build backend with embedded frontend
echo "Building backend..."
cd ..
go build -o pulse ./cmd/pulse
echo "Build complete!"
echo "To run: ./pulse or sudo systemctl restart pulse-backend"