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-20 18:47:55 +0300
committerFeross Aboukhadijeh <feross@feross.org>2014-11-20 18:47:55 +0300
commitd5ad4144b5f89c01e421900e77ff865d98a4be11 (patch)
treec1ea0282a8f8f28c38ae5bd00204f9169d564aee /bin
parent9950ed56da420cccdaa2d20bd45e744c5082cca9 (diff)
better error handling on player quit
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cmd.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/bin/cmd.js b/bin/cmd.js
index a8835b4..8c8d1bc 100755
--- a/bin/cmd.js
+++ b/bin/cmd.js
@@ -258,7 +258,10 @@ function onReady () {
var vlcPath = key.InstallDir.value + path.sep + 'vlc'
VLC_ARGS = VLC_ARGS.split(' ')
VLC_ARGS.unshift(href)
- cp.execFile(vlcPath, VLC_ARGS, errorAndExit)
+ cp.execFile(vlcPath, VLC_ARGS, function (err) {
+ if (err) return errorAndExit(err)
+ done()
+ })
}
} else if (argv.vlc) {
var root = '/Applications/VLC.app/Contents/MacOS/VLC'
@@ -275,10 +278,10 @@ function onReady () {
}
if (cmd) {
- player = cp.exec(cmd, errorAndExit)
- .on('exit', function () {
- done()
- })
+ player = cp.exec(cmd, function (err) {
+ if (err) return errorAndExit(err)
+ done()
+ })
}
if (argv.airplay) {