fix: correct frontend deps check in build script

Use 'package-lock.json -nt node_modules/.package-lock.json' to detect
when lockfile changed (e.g. after git pull). Use 'npm ci' for
deterministic install instead of 'npm install'.
This commit is contained in:
mirivlad 2026-06-15 09:32:01 +08:00
parent 767bf5c140
commit 39d3b82199
1 changed files with 2 additions and 2 deletions

View File

@ -15,9 +15,9 @@ build_gui() {
# Ensure frontend dependencies are installed
cd frontend
if [ ! -d "node_modules" ] || [ ! -f "node_modules/.package-lock.json" ]; then
if [ ! -d "node_modules" ] || [ "package-lock.json" -nt "node_modules/.package-lock.json" ]; then
echo "==> Installing frontend dependencies..."
npm install
npm ci
fi
npm run build
cd ..