Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2011-2021 GitHub Inc.
Copyright (c) 2011-2022 GitHub Inc.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
5 changes: 4 additions & 1 deletion menus/darwin.cson
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,10 @@

{
label: 'Packages'
submenu: []
submenu: [
{ label: 'Open Package Manager', command: 'settings-view:view-installed-packages' }
{ type: 'separator' }
]
}

{
Expand Down
5 changes: 4 additions & 1 deletion menus/linux.cson
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@

{
label: '&Packages'
submenu: []
submenu: [
{ label: 'Open Package Manager', command: 'settings-view:view-installed-packages' }
{ type: 'separator' }
]
}

{
Expand Down
5 changes: 4 additions & 1 deletion menus/win32.cson
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@

{
label: '&Packages'
submenu: []
submenu: [
{ label: 'Open Package Manager', command: 'settings-view:view-installed-packages' }
{ type: 'separator' }
]
}

{
Expand Down
10 changes: 3 additions & 7 deletions src/main-process/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@ const CSON = require('season');
const yargs = require('yargs');
const { app } = require('electron');

const version = `Atom : ${app.getVersion()}
Electron: ${process.versions.electron}
Chrome : ${process.versions.chrome}
Node : ${process.versions.node}`;

const args = yargs(process.argv)
.alias('v', 'version')
.version(version)
// Don't handle --help or --version here; they will be handled later.
.help(false)
.version(false)
.alias('d', 'dev')
.alias('t', 'test')
.alias('r', 'resource-path').argv;
Expand Down
19 changes: 10 additions & 9 deletions src/main-process/parse-command-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ module.exports = function parseCommandLine(processArgs) {
.alias('f', 'foreground')
.boolean('f')
.describe('f', 'Keep the main process in the foreground.');
options
.alias('h', 'help')
.boolean('h')
.describe('h', 'Print this usage message.');
options.help('help', 'Print this usage message.').alias('h', 'help');
options
.alias('l', 'log-file')
.string('l')
Expand Down Expand Up @@ -136,7 +133,16 @@ module.exports = function parseCommandLine(processArgs) {
'Enable low-level logging messages from Electron.'
);
options.boolean('uri-handler');
options
.version(
dedent`Atom : ${version}
Electron: ${process.versions.electron}
Chrome : ${process.versions.chrome}
Node : ${process.versions.node}`
)
.alias('v', 'version');

// NB: if --help or --version are given, this also displays the relevant message and exits
let args = options.argv;

// If --uri-handler is set, then we parse NOTHING else
Expand All @@ -148,11 +154,6 @@ module.exports = function parseCommandLine(processArgs) {
};
}

if (args.help) {
process.stdout.write(options.help());
process.exit(0);
}

const addToLastWindow = args['add'];
const safeMode = args['safe'];
const benchmark = args['benchmark'];
Expand Down
9 changes: 6 additions & 3 deletions src/main-process/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,18 @@ module.exports = function start(resourcePath, devResourcePath, startTime) {
}
});

const previousConsoleLog = console.log;
console.log = nslog;

// TodoElectronIssue this should be set to true before Electron 12 - https://github.com/electron/electron/issues/18397
app.allowRendererProcessReuse = false;

app.commandLine.appendSwitch('enable-experimental-web-platform-features');

const args = parseCommandLine(process.argv.slice(1));

// This must happen after parseCommandLine() because yargs uses console.log
// to display the usage message.
const previousConsoleLog = console.log;
console.log = nslog;

args.resourcePath = normalizeDriveLetterName(resourcePath);
args.devResourcePath = normalizeDriveLetterName(devResourcePath);

Expand Down