Ignore OS X -psn_xxxx command line argument

Fix #214
This commit is contained in:
Feross Aboukhadijeh
2016-04-05 22:21:22 -07:00
parent cec7556f9a
commit c26b6713de

View File

@@ -114,19 +114,18 @@ function sliceArgv (argv) {
} }
function processArgv (argv) { function processArgv (argv) {
argv.forEach(function (argvi) { argv.forEach(function (arg) {
switch (argvi) { if (arg === '-n') {
case '-n':
windows.main.send('dispatch', 'showCreateTorrent') windows.main.send('dispatch', 'showCreateTorrent')
break } else if (arg === '-o') {
case '-o':
windows.main.send('dispatch', 'showOpenTorrentFile') windows.main.send('dispatch', 'showOpenTorrentFile')
break } else if (arg === '-u') {
case '-u':
windows.main.send('showOpenTorrentAddress') windows.main.send('showOpenTorrentAddress')
break } else if (arg.startsWith('-psn')) {
default: // Ignore OS X launchd "process serial number" argument
windows.main.send('dispatch', 'onOpen', argvi) // More: https://github.com/feross/webtorrent-desktop/issues/214
} else {
windows.main.send('dispatch', 'onOpen', arg)
} }
}) })
} }