Commit 4d1a448
lib: fix: propagate exit codes from spawned processes (#3)
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 <[email protected]>
Co-authored-by: Eric Wheeler <[email protected]>1 parent 1a2c49c commit 4d1a448
File tree
5 files changed
+30
-8
lines changed- bin
- example
- scripts
- lib
5 files changed
+30
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
139 | 144 | | |
140 | | - | |
141 | | - | |
| 145 | + | |
142 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
143 | 150 | | |
0 commit comments