From 7ff57924ae3cdf54f6a32444dbc12a6514838565 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Tue, 21 Nov 2023 13:52:56 +0000 Subject: [PATCH] Fix build --- scripts/build-frontend.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/build-frontend.py b/scripts/build-frontend.py index 769f73a..b13c575 100644 --- a/scripts/build-frontend.py +++ b/scripts/build-frontend.py @@ -2,6 +2,7 @@ import os import shutil import subprocess +from sys import stderr from hatchling.builders.hooks.plugin.interface import BuildHookInterface @@ -12,7 +13,7 @@ class CustomBuildHook(BuildHookInterface): # A hack to stop building twice on run if not build_data.get("force_include"): return - print("Building Cista frontend...", version, build_data) + stderr.write("🏗️ Building Cista frontend\n") npm = shutil.which("npm") if npm is None: raise RuntimeError( @@ -21,7 +22,9 @@ class CustomBuildHook(BuildHookInterface): # npm --prefix doesn't work on Windows, so we chdir instead os.chdir("frontend") try: + stderr.write(" 》npm install\n") subprocess.run([npm, "install"], check=True) # noqa: S603 + stderr.write("\n 》npm run build\n") subprocess.run([npm, "run", "build"], check=True) # noqa: S603 finally: os.chdir("..")