Skip to content

Commit a2ffd53

Browse files
author
Benjamin E. Coe
authored
refactor!: drop handling of electron arguments (#121)
1 parent 481156a commit a2ffd53

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

index.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,8 @@ const {
4646
} = require('./errors');
4747

4848
function getMainArgs() {
49-
// This function is a placeholder for proposed process.mainArgs.
5049
// Work out where to slice process.argv for user supplied arguments.
5150

52-
// Electron is an interesting example, with workarounds implemented in
53-
// Commander and Yargs. Hopefully Electron would support process.mainArgs
54-
// itself and render this workaround moot.
55-
//
56-
// In a bundled Electron app, the user CLI args directly
57-
// follow executable. (No special processing required for unbundled.)
58-
// 1) process.versions.electron is either set by electron, or undefined
59-
// see: https://www.electronjs.org/docs/latest/api/process#processversionselectron-readonly
60-
// 2) process.defaultApp is undefined in a bundled Electron app, and set
61-
// in an unbundled Electron app
62-
// see: https://www.electronjs.org/docs/latest/api/process#processdefaultapp-readonly
63-
// (Not included in tests as hopefully temporary example.)
64-
/* c8 ignore next 3 */
65-
if (process.versions?.electron && !process.defaultApp) {
66-
return ArrayPrototypeSlice(process.argv, 1);
67-
}
68-
6951
// Check node options for scenarios where user CLI args follow executable.
7052
const execArgv = process.execArgv;
7153
if (ArrayPrototypeIncludes(execArgv, '-e') ||

0 commit comments

Comments
 (0)