fix: auto-install frontend deps in build script

Add npm install check to build_gui() — if node_modules/ is missing
or doesn't match package-lock.json, install dependencies before building.
This commit is contained in:
mirivlad 2026-06-15 09:25:28 +08:00
parent 0fdf77ce03
commit 767bf5c140
1 changed files with 8 additions and 2 deletions

View File

@ -13,8 +13,14 @@ BUILD_DIR="build"
build_gui() {
echo "==> Building GUI binary..."
# Build frontend
cd frontend && npm run build && cd ..
# Ensure frontend dependencies are installed
cd frontend
if [ ! -d "node_modules" ] || [ ! -f "node_modules/.package-lock.json" ]; then
echo "==> Installing frontend dependencies..."
npm install
fi
npm run build
cd ..
# Copy frontend dist to Wails embed directory
rm -rf cmd/verstak-gui/frontend-dist