nova-terminal-assistant 0.1.2 → 0.1.3
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/nova.js +15 -9
- package/package.json +1 -1
package/bin/nova.js
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { pathToFileURL } from 'url';
|
|
3
|
+
import { spawn } from 'child_process';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { dirname, join } from 'path';
|
|
2
6
|
|
|
3
|
-
|
|
4
|
-
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = dirname(__filename);
|
|
5
9
|
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
// Use tsx to run the TypeScript entry point
|
|
11
|
+
const tsxPath = join(__dirname, '../node_modules/tsx/dist/cli.mjs');
|
|
12
|
+
const appPath = join(__dirname, '../src/startup/NovaApp.ts');
|
|
8
13
|
|
|
9
|
-
|
|
14
|
+
const child = spawn(process.executablePath, [tsxPath, appPath, ...process.argv.slice(2)], {
|
|
15
|
+
stdio: 'inherit',
|
|
16
|
+
env: process.env
|
|
17
|
+
});
|
|
10
18
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
console.error('Fatal error:', err.message);
|
|
14
|
-
process.exit(1);
|
|
19
|
+
child.on('close', (code) => {
|
|
20
|
+
process.exit(code || 0);
|
|
15
21
|
});
|