From a2ffd537c244a062371522b955acb45a404fc9f2 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Sun, 22 May 2022 11:46:21 -0400 Subject: [PATCH] refactor!: drop handling of electron arguments (#121) --- index.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/index.js b/index.js index 238bca7..ddd51c8 100644 --- a/index.js +++ b/index.js @@ -46,26 +46,8 @@ const { } = require('./errors'); function getMainArgs() { - // This function is a placeholder for proposed process.mainArgs. // Work out where to slice process.argv for user supplied arguments. - // Electron is an interesting example, with workarounds implemented in - // Commander and Yargs. Hopefully Electron would support process.mainArgs - // itself and render this workaround moot. - // - // In a bundled Electron app, the user CLI args directly - // follow executable. (No special processing required for unbundled.) - // 1) process.versions.electron is either set by electron, or undefined - // see: https://www.electronjs.org/docs/latest/api/process#processversionselectron-readonly - // 2) process.defaultApp is undefined in a bundled Electron app, and set - // in an unbundled Electron app - // see: https://www.electronjs.org/docs/latest/api/process#processdefaultapp-readonly - // (Not included in tests as hopefully temporary example.) - /* c8 ignore next 3 */ - if (process.versions?.electron && !process.defaultApp) { - return ArrayPrototypeSlice(process.argv, 1); - } - // Check node options for scenarios where user CLI args follow executable. const execArgv = process.execArgv; if (ArrayPrototypeIncludes(execArgv, '-e') ||