Skip to content

Commit

Permalink
fix: Certificate file for sign was gone (provides with file://) under…
Browse files Browse the repository at this point in the history
… windows

Closes #619
  • Loading branch information
develar committed Jul 29, 2016
1 parent 6d8aaab commit 04a88b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/codeSign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export async function createKeychain(keychainName: string, cscLink: string, cscK
])
.then<CodeSigningInfo>(() => importCerts(keychainName, certPaths, <Array<string>>[cscKeyPassword, cscIKeyPassword].filter(it => it != null))),
errorOccurred => {
const tasks = certPaths.map((it, index) => certLinks[index].startsWith("file://") ? BluebirdPromise.resolve() : deleteFile(it, true))
const tasks = certPaths.map((it, index) => certLinks[index].startsWith("https://") ? deleteFile(it, true) : BluebirdPromise.resolve())
if (errorOccurred) {
tasks.push(deleteKeychain(keychainName))
}
Expand Down
9 changes: 6 additions & 3 deletions src/winPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,20 @@ export class WinPackager extends PlatformPackager<WinBuildOptions> {
super(info)

const certificateFile = this.platformSpecificBuildOptions.certificateFile
const cscLink = this.options.cscLink
if (certificateFile != null) {
const certificatePassword = this.platformSpecificBuildOptions.certificatePassword || this.getCscPassword()
this.cscInfo = BluebirdPromise.resolve({
file: certificateFile,
password: certificatePassword == null ? null : certificatePassword.trim(),
})
}
else if (this.options.cscLink != null) {
this.cscInfo = downloadCertificate(this.options.cscLink)
else if (cscLink != null) {
this.cscInfo = downloadCertificate(cscLink)
.then(path => {
cleanupTasks.push(() => deleteFile(path, true))
if (cscLink.startsWith("https://")) {
cleanupTasks.push(() => deleteFile(path, true))
}
return {
file: path,
password: this.getCscPassword(),
Expand Down

0 comments on commit 04a88b0

Please sign in to comment.