427a8c151a
新增终端 AppData 配置向导并强化跨平台密钥与进程树安全 升级自主构建为十六任务产物 DAG 并接入两类真实画布素材 完善完成基线、并发补验、验证证据与受限画布返工合同 强化确定性与真实 Swarm E2E 的 exactly-once 和正式产物校验 修复确定性 Provider 终态修复后的复验交付状态 同步更新客户端实现计划、决策记录和踩坑说明
47 lines
1.1 KiB
JavaScript
47 lines
1.1 KiB
JavaScript
import { spawn } from 'node:child_process';
|
|
import path from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
import { resolveGameCreatorAppConfigDir } from './game-creator-config-wizard.mjs';
|
|
|
|
const appRoot = path.resolve(fileURLToPath(new URL('..', import.meta.url)));
|
|
const cliArguments = process.argv.slice(2);
|
|
const hasConfigDir = cliArguments.some(
|
|
(argument, index) =>
|
|
argument === '--config-dir' ||
|
|
(index > 0 && cliArguments[index - 1] === '--config-dir'),
|
|
);
|
|
const runtimeConfigArguments = hasConfigDir
|
|
? []
|
|
: ['--config-dir', resolveGameCreatorAppConfigDir()];
|
|
|
|
const cargo = process.platform === 'win32' ? 'cargo.exe' : 'cargo';
|
|
const child = spawn(
|
|
cargo,
|
|
[
|
|
'run',
|
|
'--manifest-path',
|
|
'src-tauri/Cargo.toml',
|
|
'--',
|
|
...runtimeConfigArguments,
|
|
...cliArguments,
|
|
],
|
|
{
|
|
cwd: appRoot,
|
|
stdio: 'inherit',
|
|
},
|
|
);
|
|
|
|
for (const signal of ['SIGINT', 'SIGTERM']) {
|
|
process.on(signal, () => {
|
|
child.kill(signal);
|
|
});
|
|
}
|
|
|
|
child.on('exit', (code, signal) => {
|
|
if (signal) {
|
|
process.exit(1);
|
|
}
|
|
process.exit(code ?? 0);
|
|
});
|