stacktape 3.6.1 → 3.6.2
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/ai-docs/index.json +1 -1
- package/bin/stacktape.js +19 -16
- package/package.json +1 -1
package/ai-docs/index.json
CHANGED
package/bin/stacktape.js
CHANGED
|
@@ -456,32 +456,35 @@ function getGlobalBinaryPathIfVersionMatches() {
|
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
458
|
|
|
459
|
+
function executeBinary(binaryPath, args) {
|
|
460
|
+
const result = spawnSync(binaryPath, args, {
|
|
461
|
+
stdio: 'inherit',
|
|
462
|
+
env: process.env
|
|
463
|
+
});
|
|
464
|
+
|
|
465
|
+
if (result.error) {
|
|
466
|
+
throw new Error(`Error executing Stacktape binary at ${binaryPath}: ${result.error.message}`);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
if (result.signal) {
|
|
470
|
+
throw new Error(`Stacktape binary at ${binaryPath} terminated by signal ${result.signal}`);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
return typeof result.status === 'number' ? result.status : 1;
|
|
474
|
+
}
|
|
475
|
+
|
|
459
476
|
async function main() {
|
|
460
477
|
try {
|
|
461
478
|
const args = process.argv.slice(2);
|
|
462
479
|
|
|
463
480
|
const globalBinaryPath = getGlobalBinaryPathIfVersionMatches();
|
|
464
481
|
if (globalBinaryPath) {
|
|
465
|
-
|
|
466
|
-
stdio: 'inherit',
|
|
467
|
-
env: process.env
|
|
468
|
-
});
|
|
469
|
-
process.exit(result.status || 0);
|
|
482
|
+
process.exit(executeBinary(globalBinaryPath, args));
|
|
470
483
|
}
|
|
471
484
|
|
|
472
485
|
const binaryPath = await ensureBinary();
|
|
473
486
|
|
|
474
|
-
|
|
475
|
-
stdio: 'inherit',
|
|
476
|
-
env: process.env
|
|
477
|
-
});
|
|
478
|
-
|
|
479
|
-
if (result.error) {
|
|
480
|
-
console.error(`${colors.red}Error executing Stacktape binary: ${result.error.message}${colors.reset}`);
|
|
481
|
-
process.exit(1);
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
process.exit(result.status || 0);
|
|
487
|
+
process.exit(executeBinary(binaryPath, args));
|
|
485
488
|
} catch (error) {
|
|
486
489
|
console.error(`${colors.red}Unexpected error: ${error.message}${colors.reset}`);
|
|
487
490
|
process.exit(1);
|