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.
Files changed (2) hide show
  1. package/npm/peerline.js +15 -1
  2. 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.status ?? 1);
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peerline",
3
- "version": "0.1.0-alpha.18",
3
+ "version": "0.1.0-alpha.19",
4
4
  "description": "P2P post-quantum encrypted file transfer CLI",
5
5
  "repository": {
6
6
  "type": "git",