message: Use electron.app.getAppPath() instead of reading it from argv in catalina-sudo
  Changelog-entry: Use electron.app.getAppPath() instead of reading it from argv in catalina-sudo
  Change-type: patch
diff: */
  import { execFile } from 'child_process';
  +import { app, remote } from 'electron';
  import { join } from 'path';
  -import { argv, env } from 'process';
  +import { env } from 'process';
  import { promisify } from 'util';
  const execFileAsync = promisify(execFile);
  @@ -24,16 +25,6 @@ const execFileAsync = promisify(execFile);
  const SUCCESSFUL_AUTH_MARKER = 'AUTHENTICATION SUCCEEDED';
  const EXPECTED_SUCCESSFUL_AUTH_MARKER = `${SUCCESSFUL_AUTH_MARKER}\n`;
  -function getAppPath() {
  - for (const arg of argv) {
  - const [option, value] = arg.split('=');
  - if (option === '--app-path') {
  - return value;
  - }
  - }
  - throw new Error("Couldn't find --app-path= in argv");
  -}
  -
  export async function sudo(
  command: string,
  ): Promise<{ cancelled: boolean; stdout?: string; stderr?: string }> {
  @@ -46,7 +37,7 @@ export async function sudo(
  env: {
  PATH: env.PATH,
  SUDO_ASKPASS: join(
  - getAppPath(),
  + (app || remote.app).getAppPath(),
  __dirname,
  'sudo-askpass.osascript.js',
  ),
  