1
This commit is contained in:
parent
e6d6bc4074
commit
c1f528a72e
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user