Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return
}
const packager = this.packager
const qualifier = packager.platformSpecificBuildOptions.identity
// explicitly disabled if set to null
if (qualifier === null) {
// macPackager already somehow handle this situation, so, here just return
return
}
const keychainFile = (await packager.codeSigningInfo.value).keychainFile
const certificateType = "Developer ID Application"
let identity = await findIdentity(certificateType, qualifier, keychainFile)
if (identity == null) {
identity = await findIdentity("Mac Developer", qualifier, keychainFile)
if (identity == null) {
return
}
}
const args = ["--sign", identity.hash]
if (keychainFile != null) {
args.push("--keychain", keychainFile)
}
args.push(artifactPath)
await exec("codesign", args)
}
private async signDmg(artifactPath: string) {
if (!isSignAllowed(false)) {
return
}
const packager = this.packager
const qualifier = packager.platformSpecificBuildOptions.identity
// explicitly disabled if set to null
if (qualifier === null) {
// macPackager already somehow handle this situation, so, here just return
return
}
const keychainFile = (await packager.codeSigningInfo.value).keychainFile
const certificateType = "Developer ID Application"
let identity = await findIdentity(certificateType, qualifier, keychainFile)
if (identity == null) {
identity = await findIdentity("Mac Developer", qualifier, keychainFile)
if (identity == null) {
return
}
}
const args = ["--sign", identity.hash]
if (keychainFile != null) {
args.push("--keychain", keychainFile)
}
args.push(artifactPath)
await exec("codesign", args)
}