Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2014-11-27 17:42:22 +0300
committerFeross Aboukhadijeh <feross@feross.org>2014-11-27 17:42:22 +0300
commitc7e2667dfeb8efdd53f9b043deccd580b9488203 (patch)
treec7e8e313d2d2ec6de35a13e6e1c3212462586c9e /bin
parentdabe97889114ab6918c6afb77ebf33d6c492e5b7 (diff)
Control+C shuts down webtorrent on the first try
Fixes #192
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cmd.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/cmd.js b/bin/cmd.js
index b1bd92a..b649f23 100755
--- a/bin/cmd.js
+++ b/bin/cmd.js
@@ -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 } : {}))