a2acalling 0.6.7 → 0.6.8
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/package.json +1 -1
- package/scripts/postinstall.js +20 -3
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -2,8 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
// Only run for global installs; skip in CI, dev, and Docker builds.
|
|
4
4
|
if (process.env.CI || process.env.CONTINUOUS_INTEGRATION) process.exit(0);
|
|
5
|
+
if (process.env.DOCKER) process.exit(0);
|
|
5
6
|
if (process.env.npm_config_global !== 'true') process.exit(0);
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const { spawnSync } = require('child_process');
|
|
9
|
+
|
|
10
|
+
// Launch quickstart directly — stdio: 'inherit' forces foreground output
|
|
11
|
+
// even when npm v10+ suppresses postinstall stdout by default.
|
|
12
|
+
const result = spawnSync('a2a', ['quickstart'], {
|
|
13
|
+
stdio: 'inherit',
|
|
14
|
+
shell: true,
|
|
15
|
+
cwd: process.env.HOME || process.cwd()
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
if (result.error || result.status === 127) {
|
|
19
|
+
// spawn error or shell couldn't find the a2a binary
|
|
20
|
+
const reason = result.error ? result.error.message : 'a2a not found in PATH';
|
|
21
|
+
console.error('Could not auto-launch onboarding:', reason);
|
|
22
|
+
console.log('\nRun manually: a2a quickstart');
|
|
23
|
+
process.exit(0); // don't fail the install
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
process.exit(result.status || 0);
|