Skip to content

Commit

Permalink
fix: ensure status is Accepted
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed May 14, 2024
1 parent fe55db4 commit 7b49573
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/notarytool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,22 @@ export async function notarizeAndWaitForNotaryTool(opts: NotaryToolStartOptions)
];

const result = await spawn('xcrun', notarizeArgs);

if (result.code === 0) {
d('notarization success');
return;
}
const rawOut = result.output.trim();

let parsed: any;
try {
parsed = JSON.parse(result.output.trim());
parsed = JSON.parse(rawOut);
} catch (err) {
throw new Error(
`Failed to notarize via notarytool. Failed with unexpected result: \n\n${result.output.trim()}`,
`Failed to notarize via notarytool. Failed with unexpected result: \n\n${rawOut}`,
);
}

if (result.code === 0 && parsed.status === 'Accepted') {
d('notarization success');
return;
}

let logOutput: undefined | string;
if (parsed.id) {
try {
Expand Down

0 comments on commit 7b49573

Please sign in to comment.