From c1f528a72e03f36d8eea25232de64d0b1b68ed86 Mon Sep 17 00:00:00 2001 From: ZuoZuo <68836346+Mrz-sakura@users.noreply.github.com> Date: Thu, 23 Apr 2026 01:27:21 +0800 Subject: [PATCH] 1 --- monitor/service_release.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/monitor/service_release.py b/monitor/service_release.py index d125d48..b7b4809 100644 --- a/monitor/service_release.py +++ b/monitor/service_release.py @@ -1049,21 +1049,21 @@ def build_frontend_bundle( progress=progress, ) + shim_dir = worktree_root / ".hy-app-monitor-bin" + shim_dir.mkdir(parents=True, exist_ok=True) + pnpm_shim = shim_dir / "pnpm" + pnpm_shim.write_text("#!/bin/sh\nexec corepack pnpm \"$@\"\n", encoding="utf-8") + pnpm_shim.chmod(0o755) + frontend_env = { "CI": "true", "NODE_OPTIONS": "--max-old-space-size=8192", + "PATH": f"{shim_dir}:{os.environ.get('PATH', '')}", } - emit_progress(progress, "build.frontend", "准备 corepack / pnpm") - local_command_output( - ["corepack", "enable"], - cwd=worktree_root, - label="frontend corepack enable", - env=frontend_env, - timeout_seconds=120, - ) + emit_progress(progress, "build.frontend", f"已注入 pnpm shim:{pnpm_shim}") emit_progress(progress, "build.frontend.install", "开始安装前端依赖") run_logged_command( - ["corepack", "pnpm", "install", "--frozen-lockfile"], + ["pnpm", "install", "--frozen-lockfile"], cwd=worktree_root, label="frontend pnpm install", env=frontend_env, @@ -1073,7 +1073,7 @@ def build_frontend_bundle( ) emit_progress(progress, "build.frontend.build", f"开始构建静态站点:{ADMIN_FRONTEND_BUILD_SCRIPT}") run_logged_command( - ["corepack", "pnpm", "run", ADMIN_FRONTEND_BUILD_SCRIPT], + ["pnpm", "run", ADMIN_FRONTEND_BUILD_SCRIPT], cwd=worktree_root, label="frontend pnpm build", env=frontend_env,