Skip to content

Commit

Permalink
chore: additional validation and logging
Browse files Browse the repository at this point in the history
  • Loading branch information
erickzhao committed Dec 11, 2024
1 parent 8e9f3f0 commit 17b0473
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/flat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ async function validateFlatOpts (opts: FlatOptions): Promise<ValidatedFlatOption
install = '/Applications';
}

if (typeof opts.scripts === 'string' && opts.platform === 'mas') {
debugWarn('Mac App Store packages cannot have `scripts`, ignoring option.');
}

return {
...opts,
pkg,
Expand Down Expand Up @@ -114,7 +118,10 @@ export async function buildPkg (_opts: FlatOptions) {
debugLog(
'Finding `3rd Party Mac Developer Installer` certificate for flattening app distribution in the Mac App Store...'
);
identities = await findIdentities(validatedOptions.keychain || null, '3rd Party Mac Developer Installer:');
identities = await findIdentities(
validatedOptions.keychain || null,
'3rd Party Mac Developer Installer:'
);
} else {
debugLog(
'Finding `Developer ID Application` certificate for distribution outside the Mac App Store...'
Expand Down
2 changes: 2 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ type OnlyFlatOptions = {
* Path to a directory containing `preinstall.sh` or `postinstall.sh` scripts.
* These must be executable and will run on pre/postinstall depending on the file
* name.
*
* This option is only valid if {@link FlatOptions.platform} is set to `darwin`.
*/
scripts?: string;
};
Expand Down

0 comments on commit 17b0473

Please sign in to comment.