@bobfrankston/npmglobalize 1.0.173 → 1.0.174

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/lib.js +16 -0
  2. package/package.json +4 -1
package/lib.js CHANGED
@@ -410,7 +410,17 @@ export function installCleanupHandlers() {
410
410
  return;
411
411
  cleanupHandlersInstalled = true;
412
412
  process.on('exit', emergencyRestoreDeps);
413
+ // Idempotent abort: first ^C prints an immediate ack so the user doesn't
414
+ // press again and accidentally kill the process mid-restore. Subsequent
415
+ // signals while already aborting are absorbed (with a brief reminder).
416
+ let aborting = false;
413
417
  const signalHandler = (signal) => {
418
+ if (aborting) {
419
+ console.error(colors.yellow(' ...still aborting, please wait'));
420
+ return;
421
+ }
422
+ aborting = true;
423
+ console.error(colors.yellow(`\n${signal} received — aborting, restoring file: dependencies...`));
414
424
  emergencyRestoreDeps();
415
425
  process.exit(128 + (signal === 'SIGINT' ? 2 : signal === 'SIGTERM' ? 15 : 1));
416
426
  };
@@ -418,11 +428,17 @@ export function installCleanupHandlers() {
418
428
  process.on('SIGTERM', signalHandler);
419
429
  process.on('SIGHUP', signalHandler);
420
430
  process.on('uncaughtException', (err) => {
431
+ if (aborting)
432
+ return;
433
+ aborting = true;
421
434
  console.error(colors.red('\nUncaught exception:'), err);
422
435
  emergencyRestoreDeps();
423
436
  process.exit(1);
424
437
  });
425
438
  process.on('unhandledRejection', (reason) => {
439
+ if (aborting)
440
+ return;
441
+ aborting = true;
426
442
  console.error(colors.red('\nUnhandled rejection:'), reason);
427
443
  emergencyRestoreDeps();
428
444
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/npmglobalize",
3
- "version": "1.0.173",
3
+ "version": "1.0.174",
4
4
  "description": "Transform file: dependencies to npm versions for publishing",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -33,6 +33,7 @@
33
33
  "dependencies": {
34
34
  "@bobfrankston/freezepak": "^0.1.8",
35
35
  "@bobfrankston/importgen": "^0.1.35",
36
+ "@bobfrankston/mailx": "^1.0.466",
36
37
  "@bobfrankston/npmglobalize": "^1.0.153",
37
38
  "@bobfrankston/themecolors": "^0.1.6",
38
39
  "@bobfrankston/userconfig": "^1.0.8",
@@ -49,6 +50,7 @@
49
50
  ".dependencies": {
50
51
  "@bobfrankston/freezepak": "file:../freezepak",
51
52
  "@bobfrankston/importgen": "file:../importgen",
53
+ "@bobfrankston/mailx": "^1.0.466",
52
54
  "@bobfrankston/npmglobalize": "^1.0.153",
53
55
  "@bobfrankston/themecolors": "file:../themecolors",
54
56
  "@bobfrankston/userconfig": "file:../userconfig",
@@ -63,6 +65,7 @@
63
65
  "dependencies": {
64
66
  "@bobfrankston/freezepak": "^0.1.8",
65
67
  "@bobfrankston/importgen": "^0.1.35",
68
+ "@bobfrankston/mailx": "^1.0.466",
66
69
  "@bobfrankston/npmglobalize": "^1.0.153",
67
70
  "@bobfrankston/themecolors": "^0.1.6",
68
71
  "@bobfrankston/userconfig": "^1.0.8",