mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-08-17 20:34:19 +08:00
- 新增无头运行时及连接、查询、导出、批处理、审计和 MCP 命令 - 复用活动数据根、密文存储与跨进程锁,落实写入安全和取消语义 - 增加六平台 CLI 归档、独立校验和、Docker、npm 与 WinGet 分发 - 隔离 GUI/CLI 更新资产并强化 macOS 签名与公证门禁 - 补充并发、审计、事务及发布契约回归测试 Refs #902
32 lines
828 B
JavaScript
32 lines
828 B
JavaScript
#!/usr/bin/env node
|
|
|
|
const { spawn } = require('node:child_process');
|
|
const fs = require('node:fs');
|
|
const path = require('node:path');
|
|
|
|
const binaryName = process.platform === 'win32' ? 'gonavi.exe' : 'gonavi';
|
|
const binaryPath = path.join(__dirname, '.gonavi', binaryName);
|
|
|
|
if (!fs.existsSync(binaryPath)) {
|
|
console.error('GoNavi CLI is not installed. Re-run npm install so its verified release asset can be downloaded.');
|
|
process.exit(1);
|
|
}
|
|
|
|
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
stdio: 'inherit',
|
|
windowsHide: false,
|
|
});
|
|
|
|
child.on('error', (error) => {
|
|
console.error(`failed to start GoNavi CLI: ${error.message}`);
|
|
process.exit(1);
|
|
});
|
|
|
|
child.on('exit', (code, signal) => {
|
|
if (signal) {
|
|
process.kill(process.pid, signal);
|
|
return;
|
|
}
|
|
process.exit(code === null ? 1 : code);
|
|
});
|