message: Fix elevation on macos in development
  Changelog-entry: Fix elevation on macos in development
  Change-type: patch
diff: 'use strict'
  const { execFile } = require('child_process')
  -const { env, resourcesPath } = require('process')
  +const { argv, env } = require('process')
  const { join } = require('path')
  const { promisify } = require('util')
  @@ -10,6 +10,19 @@ const execFileAsync = promisify(execFile)
  const SUCCESSFUL_AUTH_MARKER = 'AUTHENTICATION SUCCEEDED'
  const EXPECTED_SUCCESSFUL_AUTH_MARKER = `${SUCCESSFUL_AUTH_MARKER}\n`
  +/* eslint-disable-next-line require-jsdoc */
  +const getAppPath = () => {
  + for (const arg of argv) {
  + /* eslint-disable-next-line lodash/prefer-lodash-method */
  + const [ option, value ] = arg.split('=')
  + if (option === '--app-path') {
  + return value
  + }
  + }
  + /* eslint-disable-next-line quotes */
  + throw new Error("Couldn't find --app-path= in argv")
  +}
  +
  exports.sudo = async (command) => {
  try {
  const { stdout, stderr } = await execFileAsync(
  @@ -19,7 +32,7 @@ exports.sudo = async (command) => {
  encoding: 'utf8',
  env: {
  PATH: env.PATH,
  - SUDO_ASKPASS: join(resourcesPath, 'app', __dirname, 'sudo-askpass.osascript.js')
  + SUDO_ASKPASS: join(getAppPath(), __dirname, 'sudo-askpass.osascript.js')
  }
  }
  )
  