Skip to content

Commit

Permalink
fix: app name contains spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
heyikang committed May 9, 2024
1 parent fcc747d commit c16dc7c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
13 changes: 2 additions & 11 deletions src/check-signature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,13 @@ import debug from 'debug';
const d = debug('electron-notarize');

const codesignDisplay = async (opts: NotarizeStapleOptions) => {
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: NotarizeStapleOptions) => {
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: NotarizeStapleOptions): Promise<void> {
Expand Down
5 changes: 1 addition & 4 deletions src/notarytool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ export async function notarizeAndWaitForNotaryTool(opts: NotaryToolStartOptions)
d('zipping application to:', filePath);
const zipResult = await spawn(
'ditto',
['-c', '-k', '--sequesterRsrc', '--keepParent', path.basename(opts.appPath), filePath],
{
cwd: path.dirname(opts.appPath),
},
['-c', '-k', '--sequesterRsrc', '--keepParent', opts.appPath, filePath],
);
if (zipResult.code !== 0) {
throw new Error(
Expand Down
5 changes: 1 addition & 4 deletions src/staple.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import debug from 'debug';
import * as path from 'path';

import { spawn } from './spawn';
import { NotarizeStapleOptions } from './types';
Expand All @@ -8,9 +7,7 @@ const d = debug('electron-notarize:staple');

export async function stapleApp(opts: NotarizeStapleOptions): Promise<void> {
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(
Expand Down

0 comments on commit c16dc7c

Please sign in to comment.