peerline 0.1.0-alpha.18 → 0.1.0-alpha.19
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/npm/peerline.js +15 -1
- package/package.json +1 -1
package/npm/peerline.js
CHANGED
|
@@ -292,7 +292,20 @@ function executeBinary(binaryPath, argv = process.argv.slice(2), deps = {}) {
|
|
|
292
292
|
|
|
293
293
|
async function main(argv = process.argv.slice(2), deps = {}) {
|
|
294
294
|
const result = executeBinary(await resolveBinary(deps), argv, deps);
|
|
295
|
-
process.exit(result
|
|
295
|
+
process.exit(exitCodeForResult(result));
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function exitCodeForResult(result) {
|
|
299
|
+
if (Number.isInteger(result?.status)) {
|
|
300
|
+
return result.status;
|
|
301
|
+
}
|
|
302
|
+
if (result?.signal === "SIGINT") {
|
|
303
|
+
return 130;
|
|
304
|
+
}
|
|
305
|
+
if (result?.signal === "SIGTERM") {
|
|
306
|
+
return 143;
|
|
307
|
+
}
|
|
308
|
+
return 1;
|
|
296
309
|
}
|
|
297
310
|
|
|
298
311
|
if (require.main === module) {
|
|
@@ -310,6 +323,7 @@ module.exports = {
|
|
|
310
323
|
downloadReleaseBinary,
|
|
311
324
|
ensureExecutable,
|
|
312
325
|
executeBinary,
|
|
326
|
+
exitCodeForResult,
|
|
313
327
|
copyBinaryToTemporaryLocation,
|
|
314
328
|
formatExecutionFallbackError,
|
|
315
329
|
isRetryableExecutionError,
|