From 9a58706e1f5e8f75f4745b050c825706e932ee32 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 30 Jan 2014 21:17:16 +0800 Subject: [PATCH] Don't pollute process.argv of browser process. --- app/atom_main_delegate.cc | 2 +- browser/default_app/main.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/atom_main_delegate.cc b/app/atom_main_delegate.cc index 1f304926db99..816df2916b13 100644 --- a/app/atom_main_delegate.cc +++ b/app/atom_main_delegate.cc @@ -66,7 +66,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-switches"); + command_line->AppendSwitch("no-more-atom-shell-switches"); } void AtomMainDelegate::InitializeResourceBundle() { diff --git a/browser/default_app/main.js b/browser/default_app/main.js index 2aff83e30b0d..acf1a38976df 100644 --- a/browser/default_app/main.js +++ b/browser/default_app/main.js @@ -1,5 +1,4 @@ var app = require('app'); -var dialog = require('dialog'); var path = require('path'); var optimist = require('optimist'); @@ -9,6 +8,10 @@ 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; // Start the specified app if there is one specified in command line, otherwise