Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Catch exit by Ctrl+C #21

Closed
Redsandro opened this issue Sep 17, 2016 · 2 comments
Closed

Catch exit by Ctrl+C #21

Redsandro opened this issue Sep 17, 2016 · 2 comments

Comments

@Redsandro
Copy link

If the script is exited by Ctrl+C, the lock is not removed.

If the script exits normally, it is caught by process.on('exit')

It should also listen to process.on('SIGINT') (linux at least).

@isaacs
Copy link
Contributor

isaacs commented Sep 21, 2016

Indeed! This module should probably use signal-exit to remove locks.

@Redsandro
Copy link
Author

Good catch, I hadn't seen that module before.

jskorepa added a commit to jskorepa/lockfile that referenced this issue Mar 14, 2018
@isaacs isaacs closed this as completed in cf093e6 Apr 17, 2018
iarna added a commit to npm/npm that referenced this issue May 3, 2018
Switches to `signal-exit` to detect abnormal exits and remove locks.

PR-URL: npm/lockfile#29
Fixes: npm/lockfile#21

Credit: @Redsandro
Reviewed-By: @isaacs
iarna added a commit to npm/npm that referenced this issue May 4, 2018
Switches to `signal-exit` to detect abnormal exits and remove locks.

PR-URL: npm/lockfile#29
Fixes: npm/lockfile#21

Credit: @Redsandro
Reviewed-By: @isaacs
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants