@@ -156,20 +156,9 @@ export default class MacPackager extends PlatformPackager<MacConfiguration> {
156156 }
157157
158158 async pack ( outDir : string , arch : Arch , targets : Array < Target > , taskManager : AsyncTaskManager ) : Promise < void > {
159- let nonMasPromise : Promise < any > | null = null
160-
161159 const hasMas = targets . length !== 0 && targets . some ( it => it . name === "mas" || it . name === "mas-dev" )
162160 const prepackaged = this . packagerOptions . prepackaged
163161
164- if ( ! hasMas || targets . length > 1 ) {
165- const appPath = prepackaged == null ? path . join ( this . computeAppOutDir ( outDir , arch ) , `${ this . appInfo . productFilename } .app` ) : prepackaged
166- nonMasPromise = (
167- prepackaged
168- ? Promise . resolve ( )
169- : this . doPack ( outDir , path . dirname ( appPath ) , this . platform . nodeName as ElectronPlatformName , arch , this . platformSpecificBuildOptions , targets )
170- ) . then ( ( ) => this . packageInDistributableFormat ( appPath , arch , targets , taskManager ) )
171- }
172-
173162 for ( const target of targets ) {
174163 const targetName = target . name
175164 if ( ! ( targetName === "mas" || targetName === "mas-dev" ) ) {
@@ -192,8 +181,12 @@ export default class MacPackager extends PlatformPackager<MacConfiguration> {
192181 }
193182 }
194183
195- if ( nonMasPromise != null ) {
196- await nonMasPromise
184+ if ( ! hasMas || targets . length > 1 ) {
185+ const appPath = prepackaged == null ? path . join ( this . computeAppOutDir ( outDir , arch ) , `${ this . appInfo . productFilename } .app` ) : prepackaged
186+ if ( prepackaged == null ) {
187+ await this . doPack ( outDir , path . dirname ( appPath ) , this . platform . nodeName as ElectronPlatformName , arch , this . platformSpecificBuildOptions , targets )
188+ }
189+ this . packageInDistributableFormat ( appPath , arch , targets , taskManager )
197190 }
198191 }
199192
0 commit comments