diff --git a/src/check-signature.ts b/src/check-signature.ts index a128eb9..b5d38ba 100644 --- a/src/check-signature.ts +++ b/src/check-signature.ts @@ -6,22 +6,13 @@ import debug from 'debug'; const d = debug('electron-notarize'); const codesignDisplay = async (opts: NotaryToolNotarizeAppOptions) => { - const result = await spawn('codesign', ['-dv', '-vvvv', '--deep', path.basename(opts.appPath)], { - cwd: path.dirname(opts.appPath), - }); + const result = await spawn('codesign', ['-dv', '-vvvv', '--deep', opts.appPath]); return result; }; const codesign = async (opts: NotaryToolNotarizeAppOptions) => { d('attempting to check codesign of app:', opts.appPath); - const result = await spawn( - 'codesign', - ['-vvv', '--deep', '--strict', path.basename(opts.appPath)], - { - cwd: path.dirname(opts.appPath), - }, - ); - + const result = await spawn('codesign', ['-vvv', '--deep', '--strict', opts.appPath]); return result; }; export async function checkSignatures(opts: NotaryToolNotarizeAppOptions): Promise { diff --git a/src/notarytool.ts b/src/notarytool.ts index c31103a..35434e9 100644 --- a/src/notarytool.ts +++ b/src/notarytool.ts @@ -81,13 +81,14 @@ export async function notarizeAndWaitForNotaryTool(opts: NotaryToolStartOptions) } else { filePath = path.resolve(dir, `${path.parse(opts.appPath).name}.zip`); d('zipping application to:', filePath); - const zipResult = await spawn( - 'ditto', - ['-c', '-k', '--sequesterRsrc', '--keepParent', path.basename(opts.appPath), filePath], - { - cwd: path.dirname(opts.appPath), - }, - ); + const zipResult = await spawn('ditto', [ + '-c', + '-k', + '--sequesterRsrc', + '--keepParent', + opts.appPath, + filePath, + ]); if (zipResult.code !== 0) { throw new Error( `Failed to zip application, exited with code: ${zipResult.code}\n\n${zipResult.output}`, diff --git a/src/staple.ts b/src/staple.ts index 6a24c7f..92af881 100644 --- a/src/staple.ts +++ b/src/staple.ts @@ -1,5 +1,4 @@ import debug from 'debug'; -import * as path from 'path'; import { spawn } from './spawn'; import { NotaryToolNotarizeAppOptions } from './types'; @@ -8,9 +7,7 @@ const d = debug('electron-notarize:staple'); export async function stapleApp(opts: NotaryToolNotarizeAppOptions): Promise { d('attempting to staple app:', opts.appPath); - const result = await spawn('xcrun', ['stapler', 'staple', '-v', path.basename(opts.appPath)], { - cwd: path.dirname(opts.appPath), - }); + const result = await spawn('xcrun', ['stapler', 'staple', '-v', opts.appPath]); if (result.code !== 0) { throw new Error(