1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-11 18:24:43 +02:00

Electron: Fixes #480: Ignore invalid flag automatically passed by macOS

This commit is contained in:
Laurent Cozic 2018-05-02 15:51:33 +01:00
parent 5f32c6466a
commit 4c210d0956
2 changed files with 10 additions and 1 deletions

View File

@ -143,6 +143,14 @@ class BaseApplication {
continue; continue;
} }
if (arg.indexOf('-psn') === 0) {
// Some weird flag passed by macOS - can be ignored.
// https://github.com/laurent22/joplin/issues/480
// https://stackoverflow.com/questions/10242115
argv.splice(0, 1);
continue;
}
if (arg.length && arg[0] == '-') { if (arg.length && arg[0] == '-') {
throw new JoplinError(_('Unknown flag: %s', arg), 'flagError'); throw new JoplinError(_('Unknown flag: %s', arg), 'flagError');
} else { } else {

View File

@ -91,9 +91,10 @@ async function main(argv) {
setReadmeContent(content); setReadmeContent(content);
console.info("git pull && git add -A && git commit -m 'Update readme downloads' && git push") // console.info("git pull && git add -A && git commit -m 'Update readme downloads' && git push")
} }
main(process.argv).catch((error) => { main(process.argv).catch((error) => {
console.error('Fatal error', error); console.error('Fatal error', error);
process.exit(1);
}); });