v1.8.2-beta.1
This commit is contained in:
parent
cf12d31875
commit
90e7d7e112
6 changed files with 22 additions and 10 deletions
|
@ -28,7 +28,19 @@ function uploadToGitHub () {
|
|||
if (retry < 4) {
|
||||
console.log(`Error uploading ${fileName} to GitHub, will retry. Error was:`, err)
|
||||
retry++
|
||||
uploadToGitHub()
|
||||
github.repos.getAssets(githubOpts).then(assets => {
|
||||
let existingAssets = assets.data.filter(asset => asset.name === fileName)
|
||||
if (existingAssets.length > 0) {
|
||||
console.log(`${fileName} already exists; will delete before retrying upload.`)
|
||||
github.repos.deleteAsset({
|
||||
owner: 'electron',
|
||||
repo: 'electron',
|
||||
id: existingAssets[0].id
|
||||
}).then(uploadToGitHub).catch(uploadToGitHub)
|
||||
} else {
|
||||
uploadToGitHub()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log(`Error retrying uploading ${fileName} to GitHub:`, err)
|
||||
process.exitCode = 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue