Skip to content

Instantly share code, notes, and snippets.

@dvigne
Created November 14, 2021 05:10
Show Gist options
  • Save dvigne/94496537600ddc42e04daa872d04553a to your computer and use it in GitHub Desktop.
Save dvigne/94496537600ddc42e04daa872d04553a to your computer and use it in GitHub Desktop.
Electron Forge Post Package Hook for Deep Signing on Mac
hooks: {
postPackage: (forgeConfig, options) => {
if (process.platform == "darwin") {
let appPath = path.resolve(options.outputPaths[0], 'CHANGEME.app');
console.log(`Signing App: ${appPath}`);
exec(`codesign --force --deep --sign - ${appPath}`,
(err, stdout, stderr) => {
if (err) {
console.log(`ERROR: ${err}`);
}
if (stdout) {
console.log(stdout);
}
if (stderr) {
console.log(stderr);
}
});
}
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment