Files
Genarrative/apps/ai-game-creator-shell/scripts/run-cli-with-config.mjs
T
AIGameCreator App 588a529875 改用客户端运行时配置
移除 AI 游戏创作壳专属 .env 读取,改为默认配置模板与 Tauri 运行时配置。

新增主窗口配置面板,读写 LLM 与画板 API 配置。

更新 CLI smoke、门禁、测试和项目文档。
2026-06-30 15:13:51 +08:00

35 lines
674 B
JavaScript

import { spawn } from 'node:child_process';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const appRoot = path.resolve(fileURLToPath(new URL('..', import.meta.url)));
const cargo = process.platform === 'win32' ? 'cargo.exe' : 'cargo';
const child = spawn(
cargo,
[
'run',
'--manifest-path',
'src-tauri/Cargo.toml',
'--',
...process.argv.slice(2),
],
{
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);
});