diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2014-11-27 17:42:22 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2014-11-27 17:42:22 +0300 |
commit | c7e2667dfeb8efdd53f9b043deccd580b9488203 (patch) | |
tree | c7e8e313d2d2ec6de35a13e6e1c3212462586c9e /bin | |
parent | dabe97889114ab6918c6afb77ebf33d6c492e5b7 (diff) |
Control+C shuts down webtorrent on the first try
Fixes #192
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/cmd.js | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -145,10 +145,15 @@ if (!argv.out) { // If no output file has been specified process.on('SIGTERM', remove) } -function remove (cb) { +function remove () { process.removeListener('SIGINT', remove) process.removeListener('SIGTERM', remove) - client.destroy(cb) + + // destroying can take a while, so print a message to the user + clivas.line('') + clivas.line('{green:webtorrent is exiting...}') + + client.destroy(process.exit) } var torrent = client.add(torrentId, (argv.out ? { tmp: argv.out } : {})) |