Exit with 1 and a message when -a and -n are both provided

This commit is contained in:
Ash Wilson
2019-03-22 11:29:21 -04:00
parent 372652915e
commit 2526e69e28
2 changed files with 42 additions and 3 deletions

View File

@@ -105,6 +105,16 @@ module.exports = function parseCommandLine (processArgs) {
executedFrom = process.cwd()
}
if (newWindow && addToLastWindow) {
process.stderr.write(
`Only one of the --add and --new-window options may be specified at the same time.\n\n${options.help()}`,
)
// Exiting the main process with a nonzero exit code on MacOS causes the app open to fail with the mysterious
// message "LSOpenURLsWithRole() failed for the application /Applications/Atom Dev.app with error -10810."
process.exit(0)
}
let pidToKillWhenClosed = null
if (args['wait']) {
pidToKillWhenClosed = args['pid']