Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
signAppIfSpecified () {
let osxSignOpt = this.opts.osxSign
let platform = this.opts.platform
let version = this.opts.electronVersion
if ((platform === 'all' || platform === 'mas') &&
osxSignOpt === undefined) {
common.warning('signing is required for mas builds. Provide the osx-sign option, ' +
'or manually sign the app later.')
}
if (osxSignOpt) {
const signOpts = createSignOpts(osxSignOpt, platform, this.renamedAppPath, version, this.opts.quiet)
debug(`Running electron-osx-sign with the options ${JSON.stringify(signOpts)}`)
return sign(signOpts)
// Although not signed successfully, the application is packed.
.catch(err => common.warning(`Code sign failed; please retry manually. ${err}`))
} else {
return Promise.resolve()
}
}
async signAppIfSpecified () {
const osxSignOpt = this.opts.osxSign
const platform = this.opts.platform
const version = this.opts.electronVersion
if ((platform === 'all' || platform === 'mas') &&
osxSignOpt === undefined) {
common.warning('signing is required for mas builds. Provide the osx-sign option, ' +
'or manually sign the app later.')
}
if (osxSignOpt) {
const signOpts = createSignOpts(osxSignOpt, platform, this.renamedAppPath, version, this.opts.osxNotarize, this.opts.quiet)
debug(`Running electron-osx-sign with the options ${JSON.stringify(signOpts)}`)
try {
await signAsync(signOpts)
} catch (err) {
// Although not signed successfully, the application is packed.
common.warning(`Code sign failed; please retry manually. ${err}`)
}
}
}