v1.8.2-beta.1

This commit is contained in:
John Kleinschmidt 2017-10-18 16:49:32 -04:00
parent cf12d31875
commit 90e7d7e112
6 changed files with 22 additions and 10 deletions

View file

@ -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