Skip to content

Commit

Permalink
fix(mas): Warning when using entitlements.mas.plist
Browse files Browse the repository at this point in the history
Closes #729
  • Loading branch information
develar committed Sep 8, 2016
1 parent a1b2b0e commit 5031116
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions src/macPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,41 +134,32 @@ export default class MacPackager extends PlatformPackager<MacOptions> {
}, (<any>this.devMetadata.build)["osx-sign"], baseSignOptions)

const resourceList = await this.resourceList
if (resourceList.includes(`entitlements.osx.plist`)) {
throw new Error("entitlements.osx.plist is deprecated name, please use entitlements.mac.plist")
}
if (resourceList.includes(`entitlements.osx.inherit.plist`)) {
throw new Error("entitlements.osx.inherit.plist is deprecated name, please use entitlements.mac.inherit.plist")
}

const customSignOptions = masOptions || this.platformSpecificBuildOptions
if (customSignOptions.entitlements != null) {
signOptions.entitlements = customSignOptions.entitlements
}
else {
let p = `entitlements.${masOptions == null ? "osx" : "mas"}.plist`
const p = `entitlements.${masOptions == null ? "mac" : "mas"}.plist`
if (resourceList.includes(p)) {
warn("entitlements.osx.plist is deprecated name, please use entitlements.mac.plist")
signOptions.entitlements = path.join(this.buildResourcesDir, p)
}

if (masOptions == null) {
p = `entitlements.mac.plist`
if (resourceList.includes(p)) {
signOptions.entitlements = path.join(this.buildResourcesDir, p)
}
}
}

if (customSignOptions.entitlementsInherit != null) {
signOptions["entitlements-inherit"] = customSignOptions.entitlementsInherit
}
else {
let p = `entitlements.${masOptions == null ? "osx" : "mas"}.inherit.plist`
const p = `entitlements.${masOptions == null ? "mac" : "mas"}.inherit.plist`
if (resourceList.includes(p)) {
warn("entitlements.osx.inherit.plist is deprecated name, please use entitlements.mac.inherit.plist")
signOptions["entitlements-inherit"] = path.join(this.buildResourcesDir, p)
}
if (masOptions == null) {
p = `entitlements.mac.inherit.plist`
if (resourceList.includes(p)) {
signOptions["entitlements-inherit"] = path.join(this.buildResourcesDir, p)
}
}
}

await task(`Signing app (identity: ${name})`, this.doSign(signOptions))
Expand Down

0 comments on commit 5031116

Please sign in to comment.