mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Fix how we filter out atom-shell switches in process.argv.
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user