@@ -22,26 +22,25 @@ import { createCommonTarget, NoOpTarget } from "./targets/targetFactory"
2222import { CONCURRENCY } from "builder-util/out/fs"
2323
2424export default class MacPackager extends PlatformPackager < MacConfiguration > {
25- readonly codeSigningInfo : Promise < CodeSigningInfo >
25+ readonly codeSigningInfo = new Lazy < CodeSigningInfo > ( ( ) => {
26+ if ( this . packagerOptions . cscLink == null || process . platform !== "darwin" ) {
27+ return Promise . resolve ( { keychainName : process . env . CSC_KEYCHAIN || null } )
28+ }
29+
30+ return createKeychain ( {
31+ tmpDir : this . info . tempDirManager ,
32+ cscLink : this . packagerOptions . cscLink ! ,
33+ cscKeyPassword : this . getCscPassword ( ) ,
34+ cscILink : this . packagerOptions . cscInstallerLink ,
35+ cscIKeyPassword : this . packagerOptions . cscInstallerKeyPassword ,
36+ currentDir : this . projectDir
37+ } )
38+ } )
2639
2740 private _iconPath = new Lazy ( ( ) => this . getOrConvertIcon ( "icns" ) )
2841
2942 constructor ( info : Packager ) {
3043 super ( info , Platform . MAC )
31-
32- if ( this . packagerOptions . cscLink == null || process . platform !== "darwin" ) {
33- this . codeSigningInfo = BluebirdPromise . resolve ( { keychainName : process . env . CSC_KEYCHAIN || null } )
34- }
35- else {
36- this . codeSigningInfo = createKeychain ( {
37- tmpDir : info . tempDirManager ,
38- cscLink : this . packagerOptions . cscLink ! ,
39- cscKeyPassword : this . getCscPassword ( ) ,
40- cscILink : this . packagerOptions . cscInstallerLink ,
41- cscIKeyPassword : this . packagerOptions . cscInstallerKeyPassword ,
42- currentDir : this . projectDir
43- } )
44- }
4544 }
4645
4746 get defaultTarget ( ) : Array < string > {
@@ -141,7 +140,7 @@ export default class MacPackager extends PlatformPackager<MacConfiguration> {
141140 return
142141 }
143142
144- const keychainName = ( await this . codeSigningInfo ) . keychainName
143+ const keychainName = ( await this . codeSigningInfo . value ) . keychainName
145144 const explicitType = isMas ? masOptions ! . type : macOptions . type
146145 const type = explicitType || "distribution"
147146 const isDevelopment = type === "development"
@@ -264,7 +263,7 @@ export default class MacPackager extends PlatformPackager<MacConfiguration> {
264263 await createMacApp ( this , appOutDir , asarIntegrity )
265264
266265 const wantedLanguages = asArray ( this . platformSpecificBuildOptions . electronLanguages )
267- if ( wantedLanguages == null ) {
266+ if ( wantedLanguages . length === 0 ) {
268267 return
269268 }
270269
0 commit comments