]> khamidou — GitHub mirrors - electron.git/commitdiff
Fix how we filter out atom-shell switches in process.argv.
authorCheng Zhao <zcbenz@gmail.com>
Fri, 31 Jan 2014 08:40:20 +0000 (16:40 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 31 Jan 2014 08:40:20 +0000 (16:40 +0800)
app/atom_main_delegate.cc
browser/default_app/main.js
browser/lib/init.coffee

index 816df2916b13a8bf192b62cdc0a448e47e9d5808..d8f0c693d494e672326a1d8f0c64961093c124f9 100644 (file)
@@ -58,6 +58,9 @@ void AtomMainDelegate::PreSandboxStartup() {
   if (process_type == switches::kRendererProcess)
     return;
 
+  // Add a flag to mark the start of switches added by atom-shell.
+  command_line->AppendSwitch("atom-shell-switches-start");
+
   // Disable renderer sandbox for most of node's functions.
   command_line->AppendSwitch(switches::kNoSandbox);
 
@@ -66,7 +69,7 @@ void AtomMainDelegate::PreSandboxStartup() {
   command_line->AppendSwitch(switches::kDisableAcceleratedCompositing);
 
   // Add a flag to mark the end of switches added by atom-shell.
-  command_line->AppendSwitch("no-more-atom-shell-switches");
+  command_line->AppendSwitch("atom-shell-switches-end");
 }
 
 void AtomMainDelegate::InitializeResourceBundle() {
index acf1a38976df55bede59689bc82fda0717dad39a..b3e3bcb03640261727384df34f8657cc45b539e0 100644 (file)
@@ -8,11 +8,7 @@ app.on('window-all-closed', function() {
     app.quit();
 });
 
-// Pick out switches appended by atom-shell.
-var endMark = process.argv.indexOf('--no-more-atom-shell-switches');
-process.execArgv = process.argv.splice(1, endMark)
-
-var argv = optimist(process.argv.slice(1)).argv;
+var argv = optimist(process.argv.slice(1)).boolean('ci').argv;
 
 // Start the specified app if there is one specified in command line, otherwise
 // start the default app.
index 950d4671ac56d32fb281f574a2a8fe187d938e7f..1b22b3d259b38968b2ccd388f4d48a41248c9da4 100644 (file)
@@ -9,6 +9,11 @@ process.resourcesPath = path.resolve process.argv[1], '..', '..', '..'
 # we need to restore it here.
 process.argv.splice 1, 1
 
+# Pick out switches appended by atom-shell.
+startMark = process.argv.indexOf '--atom-shell-switches-start'
+endMark = process.argv.indexOf '--atom-shell-switches-end'
+process.execArgv = process.argv.splice startMark, endMark - startMark + 1
+
 # Add browser/api/lib to require's search paths,
 # which contains javascript part of Atom's built-in libraries.
 globalPaths = require('module').globalPaths