electron-publish
Advanced tools
Comparing version 23.0.0-alpha.0 to 23.0.0-alpha.1
@@ -30,2 +30,3 @@ /// <reference types="node" /> | ||
private doUploadFile; | ||
private doesErrorMeanAlreadyExists; | ||
private createRelease; | ||
@@ -32,0 +33,0 @@ getRelease(): Promise<any>; |
@@ -146,3 +146,3 @@ "use strict"; | ||
.catch(e => { | ||
if (e.statusCode === 422 && e.description != null && e.description.errors != null && e.description.errors[0].code === "already_exists") { | ||
if (this.doesErrorMeanAlreadyExists(e)) { | ||
return this.overwriteArtifact(fileName, release).then(() => this.doUploadFile(attemptNumber, parsedUrl, fileName, dataLength, requestProcessor, release)); | ||
@@ -163,2 +163,10 @@ } | ||
} | ||
doesErrorMeanAlreadyExists(e) { | ||
if (!e.description) { | ||
return false; | ||
} | ||
const desc = e.description; | ||
const descIncludesAlreadyExists = (desc.includes("errors") && desc.includes("already_exists")) || (desc.errors && desc.errors.length >= 1 && desc.errors[0].code === "already_exists"); | ||
return e.statusCode === 422 && descIncludesAlreadyExists; | ||
} | ||
createRelease() { | ||
@@ -165,0 +173,0 @@ return this.githubRequest(`/repos/${this.info.owner}/${this.info.repo}/releases`, this.token, { |
{ | ||
"name": "electron-publish", | ||
"version": "23.0.0-alpha.0", | ||
"version": "23.0.0-alpha.1", | ||
"main": "out/publisher.js", | ||
@@ -5,0 +5,0 @@ "author": "Vladimir Krivosheev", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74451
690