Add afterPack hook for ad-hoc code signing on macOS

This commit is contained in:
Anil Matcha 2026-03-18 12:30:06 +05:30
commit 541246fca9
2 changed files with 12 additions and 0 deletions

11
afterPack.js Normal file
View file

@ -0,0 +1,11 @@
import { execSync } from 'child_process';
import path from 'path';
export default async function afterPack({ appOutDir, packager }) {
if (packager.platform.name !== 'mac') return;
const appPath = path.join(appOutDir, `${packager.appInfo.productName}.app`);
console.log(` • ad-hoc signing path=${appPath}`);
execSync(`codesign --deep --force --sign - "${appPath}"`, { stdio: 'inherit' });
console.log(` • ad-hoc signing complete`);
}

View file

@ -22,6 +22,7 @@
"directories": {
"output": "release"
},
"afterPack": "./afterPack.js",
"files": [
"dist/**/*",
"electron/**/*"