aicp-tracker 1.0.4 → 1.0.7
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/setup.js +8 -6
- package/package.json +1 -1
package/bin/setup.js
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
// Runs on `npm install` (postinstall). Skipped in CI environments.
|
|
5
5
|
if (process.env.CI || process.env.npm_config_yes) process.exit(0);
|
|
6
6
|
|
|
7
|
+
const path = require('path');
|
|
8
|
+
|
|
7
9
|
// Skip if already fully configured (upgrade path — no prompts needed)
|
|
8
10
|
const isPostinstall = process.env.npm_lifecycle_event === 'postinstall';
|
|
9
11
|
if (isPostinstall) {
|
|
@@ -11,11 +13,12 @@ if (isPostinstall) {
|
|
|
11
13
|
try { existing = require('../src/config').load(); } catch {}
|
|
12
14
|
if (existing?.apiKey && existing?.vcsUrl) process.exit(0);
|
|
13
15
|
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
process.
|
|
16
|
+
// spawnSync with stdio:'inherit' passes the real terminal descriptors to the child,
|
|
17
|
+
// giving enquirer a proper TTY without opening a separate window.
|
|
18
|
+
const { spawnSync } = require('child_process');
|
|
19
|
+
const wizardPath = path.resolve(__dirname, 'aicp-tracker.js');
|
|
20
|
+
const result = spawnSync(process.execPath, [wizardPath, 'setup'], { stdio: 'inherit' });
|
|
21
|
+
process.exit(result.status || 0);
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
// ── When called directly (aicp-tracker setup) ─────────────────────────────────
|
|
@@ -24,7 +27,6 @@ const { prompt } = require('enquirer');
|
|
|
24
27
|
const { execSync } = require('child_process');
|
|
25
28
|
const fs = require('fs');
|
|
26
29
|
const os = require('os');
|
|
27
|
-
const path = require('path');
|
|
28
30
|
const config = require('../src/config');
|
|
29
31
|
const daemon = require('../src/daemon');
|
|
30
32
|
|