first submle

This commit is contained in:
gcdsfh145
2026-05-03 07:34:04 +08:00
parent a29fd59c30
commit c0620c2064
15 changed files with 3798 additions and 2 deletions
Executable
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env node
// ExCLI 入口脚本
import { run } from '../src/index.js';
// 全局错误处理
process.on('uncaughtException', (error) => {
// 忽略 readline 关闭错误(使用管道输入时会出现)
if (error.message === 'readline was closed' || error.message === 'Cannot read properties of undefined (reading \'isPaused\')') {
return;
}
console.error('未捕获的错误:', error.message);
process.exit(1);
});
process.on('unhandledRejection', (reason) => {
// 忽略 readline 关闭错误
if (reason?.message === 'readline was closed') {
return;
}
console.error('未处理的 Promise 拒绝:', reason);
process.exit(1);
});
// 运行程序
run().catch((error) => {
// 忽略 readline 关闭错误
if (error?.message === 'readline was closed') {
return;
}
console.error('启动错误:', error.message);
process.exit(1);
});