From 8a0990603d22d8cbad833b8efe68dd93a1437cac Mon Sep 17 00:00:00 2001 From: Andrew Goldis Date: Fri, 30 Apr 2021 13:46:49 -0700 Subject: [PATCH] fix: exit with child's exit code Closes #5. --- lib/patch.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/patch.js b/lib/patch.js index 9ed7074..6ca20d7 100644 --- a/lib/patch.js +++ b/lib/patch.js @@ -40,6 +40,8 @@ exports.patch = function () { fs.writeFileSync(configFilePath, yaml.dump(doc)); const [node, script, ...rest] = process.argv; - cp.spawn(cliBinPath, [...rest], { stdio: 'inherit' }); + const child = cp.spawn(cliBinPath, [...rest], { stdio: 'inherit' }); + + child.on('exit', (code) => process.exit(code)); }); };