File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ const config = {
2626 ] ,
2727 publish : null ,
2828 afterSign : './scripts/afterSignHook.js' ,
29+ afterPack : './scripts/afterPack.js' ,
2930 extraResources : [
3031 {
3132 from : './bin' ,
@@ -43,6 +44,8 @@ const config = {
4344 } ,
4445 fileAssociations : [ ] ,
4546 mac : {
47+ // disabling notarize on electron-builder, we use afterSignHook.js
48+ notarize : false ,
4649 hardenedRuntime : true ,
4750 category : 'public.app-category.developer-tools' ,
4851 entitlements : './build/static/entitlements.mac.inherit.plist' ,
Original file line number Diff line number Diff line change 1+ /* Remove these hacks when this bug is fixed
2+ * https://github.com/electron-userland/electron-builder/issues/7317
3+ * Adapted from https://github.com/electron-userland/electron-builder/issues/7317#issuecomment-1351168459
4+ */
5+
6+ exports . default = async function patchSign ( context ) {
7+ if ( context . electronPlatformName !== 'darwin' ) {
8+ return ;
9+ }
10+ const asoSave = context . packager . adjustSignOptions ;
11+ if ( asoSave . patched ) {
12+ return ;
13+ }
14+ console . log ( '[afterpack] Applying adjustSignOptions hack, see electron-userland/electron-builder#7317' ) ;
15+ context . packager . adjustSignOptions = async function ( signOptions , masOptions ) {
16+ await asoSave . call ( this , signOptions , masOptions ) ;
17+ if ( typeof signOptions . identity === 'object' && signOptions . identity . name ) {
18+ console . warn ( '[afterpack] Applying signOptions hack for signing identity.' ) ;
19+ signOptions . identity = signOptions . identity . name ;
20+ }
21+ if ( signOptions [ 'identity-validation' ] !== undefined ) {
22+ console . warn ( '[afterpack] Applying identity validation hack.' ) ;
23+ signOptions . identityValidation = signOptions [ 'identity-validation' ] ;
24+ delete signOptions [ 'identity-validation' ] ;
25+ }
26+ } ;
27+ context . packager . adjustSignOptions . patched = true ;
28+ } ;
You can’t perform that action at this time.
0 commit comments