Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,15 @@ def list_str(values):
if args.build:
if os.path.exists(f"{MAGMA_PATH}") and len(os.listdir(MAGMA_PATH)) > 0:
logging.info("Building VueJS front-end.")
subprocess.run(["npm", "install"], cwd=MAGMA_PATH, check=True)
package_lock = os.path.join(MAGMA_PATH, "package-lock.json")
if os.path.isfile(package_lock):
subprocess.run(["npm", "ci"], cwd=MAGMA_PATH, check=True)
else:
raise FileNotFoundError(
f"package-lock.json not found at {package_lock}. "
"A lockfile is required for reproducible builds. "
"Commit package-lock.json or run 'npm install' locally to generate it."
)
Comment on lines +294 to +299
Comment on lines +290 to +299
subprocess.run(["npm", "run", "build"], cwd=MAGMA_PATH, check=True)
logging.info("VueJS front-end build complete.")
else:
Expand Down
Loading