ai-cto 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +16 -1
- package/docs/STACK.md +1 -1
- package/package.json +2 -2
- package/docs/PLAN.md +0 -0
package/bin/cli.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import readline from 'readline';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import fs from 'fs';
|
|
4
6
|
|
|
5
7
|
// ---------------------------------------------------------
|
|
6
8
|
// Game Data Definition
|
|
@@ -485,7 +487,20 @@ async function main() {
|
|
|
485
487
|
process.exit(0);
|
|
486
488
|
}
|
|
487
489
|
|
|
488
|
-
|
|
490
|
+
function isMainModule() {
|
|
491
|
+
if (!process.argv[1]) return false;
|
|
492
|
+
try {
|
|
493
|
+
const mainPath = fs.realpathSync(process.argv[1]);
|
|
494
|
+
const currentPath = fileURLToPath(import.meta.url);
|
|
495
|
+
if (mainPath === currentPath) return true;
|
|
496
|
+
} catch {
|
|
497
|
+
// ignore
|
|
498
|
+
}
|
|
499
|
+
const argv1 = process.argv[1];
|
|
500
|
+
return argv1.endsWith('cli.js') || argv1.endsWith('ai-cto') || argv1.endsWith('aicto');
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
if (isMainModule()) {
|
|
489
504
|
main().catch(console.error);
|
|
490
505
|
}
|
|
491
506
|
|
package/docs/STACK.md
CHANGED
package/package.json
CHANGED
package/docs/PLAN.md
DELETED
|
File without changes
|