stacktape 3.6.0 → 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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-03-13T12:34:20.646Z",
2
+ "generatedAt": "2026-03-13T14:52:52.767Z",
3
3
  "version": "1.0",
4
4
  "synonymMap": {
5
5
  "function": [
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
- const result = spawnSync(globalBinaryPath, args, {
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
- const result = spawnSync(binaryPath, args, {
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);