16 lines
552 B
JavaScript
16 lines
552 B
JavaScript
// Post-build hook: ad-hoc sign the .app bundle so macOS 14+ will open it
|
|
// without requiring an Apple Developer certificate.
|
|
const { execSync } = require('child_process');
|
|
const path = require('path');
|
|
|
|
exports.default = async function (context) {
|
|
const appPath = path.join(
|
|
context.appOutDir,
|
|
`${context.packager.appInfo.productFilename}.app`,
|
|
);
|
|
console.log(`Ad-hoc signing: ${appPath}`);
|
|
execSync(`xattr -cr "${appPath}"`);
|
|
execSync(`codesign --force --deep --sign - "${appPath}"`);
|
|
console.log('Ad-hoc signing complete.');
|
|
};
|