diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2014-11-20 18:47:55 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2014-11-20 18:47:55 +0300 |
commit | d5ad4144b5f89c01e421900e77ff865d98a4be11 (patch) | |
tree | c1ea0282a8f8f28c38ae5bd00204f9169d564aee /bin | |
parent | 9950ed56da420cccdaa2d20bd45e744c5082cca9 (diff) |
better error handling on player quit
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/cmd.js | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -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) { |