Skip to content

Conversation

@KJ7LNW
Copy link
Contributor

@KJ7LNW KJ7LNW commented Oct 12, 2025

Summary

Fixes a fundamental bug where run-shared-scripts never propagates exit codes from spawned processes, causing all scripts to appear successful even when they fail.

Previously, the run() function spawned child processes but never waited for them or captured their exit codes. This made it impossible for CI systems and build pipelines to detect failures.

Changes

  • Modified lib/index.js:134: Wrap spawn in Promise that resolves with child process exit code
  • Modified bin/rss.js:44: Await run() and set process.exitCode
  • Return exit code 0 for successful execution and dry-run mode
  • Return exit code 1 when script name not found in rss configuration
  • Added example test scripts demonstrating exit code propagation

Test plan

  • Test script with exit code 0 returns 0
  • Test script with exit code 42 returns 42
  • Unknown script returns exit code 1
  • Existing test scripts continue to work

Fixes: #2

The run-shared-scripts tool spawned child processes but never waited
for them to complete or captured their exit codes, causing all scripts
to appear successful even when they failed. This made it impossible for
CI systems and build pipelines to detect failures.

The run() function now returns a Promise that resolves with the child
process exit code, and the bin script awaits this result and sets
process.exitCode accordingly.

- Modified lib/index.js: wrap spawn in Promise, resolve with exit code
- Modified bin/rss.js: await run() and set process.exitCode
- Return 0 for successful execution and dry-run mode
- Return 1 when script name not found in rss configuration
- Added example test scripts to verify exit code propagation

Signed-off-by: Eric Wheeler <git-default@z.ewheeler.org>
@KJ7LNW KJ7LNW mentioned this pull request Oct 12, 2025
@KJ7LNW
Copy link
Contributor Author

KJ7LNW commented Oct 12, 2025

OSX failed, but it is unrelated to this PR's changeset.

@bubkoo bubkoo merged commit 4d1a448 into bubkoo:master Oct 15, 2025
1 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failure result not returned

2 participants