Files
cindy/apps/desktop/scripts/forge-cli.mjs
MagicLizi 8735d6be94 feat: 完善 Cindy Make 制作、设备聚合与任务收口
补齐制作构建诊断、上游合并清理、设备聚合与 Mobile 资源展示,并修复 deferred product turn failure owner 的生命周期竞态。

验证:pnpm.cmd test:unit:related;Desktop/Mobile typecheck;check:i18n、check:i18n-glossary、check:design-inventory、check:design-colors。

Signed-off-by: MagicLizi <jiali@magiclizi.com>
2026-09-21 22:50:52 +08:00

34 lines
990 B
JavaScript

#!/usr/bin/env node
// Keep the direct `package` and `build` scripts on the same Forge environment
// as the release wrapper. The launcher must set NODE_OPTIONS before Node starts
// Forge; changing process.env from forge.config.ts would be too late for the
// Forge process that owns the Main/Renderer compilation.
import { createRequire } from 'node:module';
import { spawnSync } from 'node:child_process';
import { packageNodeOptions } from './ci/package-lib.mjs';
const require = createRequire(import.meta.url);
const forgeCli = require.resolve('@electron-forge/cli/dist/electron-forge.js');
const result = spawnSync(
process.execPath,
[forgeCli, ...process.argv.slice(2)],
{
cwd: process.cwd(),
env: {
...process.env,
NODE_OPTIONS: packageNodeOptions(process.env),
},
stdio: 'inherit',
},
);
if (result.error) {
console.error(`Failed to start electron-forge: ${result.error.message}`);
process.exit(1);
}
process.exit(result.status ?? 1);