Various build fixes, cleanup and details #6

Merged
leo merged 34 commits from trace into main 2023-11-21 15:32:49 +00:00
Showing only changes of commit 226ac67d26 - Show all commits

View File

@ -1,4 +1,5 @@
# noqa: INP001
import os
import shutil
import subprocess
@ -17,6 +18,10 @@ class CustomBuildHook(BuildHookInterface):
raise RuntimeError(
"NodeJS `npm` is required for building Cista but it was not found"
)
frontend = "frontend"
subprocess.run([npm, "install", "--prefix", frontend], check=True) # noqa: S603
subprocess.run([npm, "run", "build", "--prefix", frontend], check=True) # noqa: S603
# npm --prefix doesn't work on Windows, so we chdir instead
os.chdir("frontend")
try:
subprocess.run([npm, "install"], check=True) # noqa: S603
subprocess.run([npm, "run", "build"], check=True) # noqa: S603
finally:
os.chdir("..")