We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d7aa0b0 commit 54563dcCopy full SHA for 54563dc
script/upload-to-github.js
@@ -13,9 +13,22 @@ let githubOpts = {
13
filePath: filePath,
14
name: fileName
15
}
16
-github.repos.uploadAsset(githubOpts).then(() => {
17
- process.exit()
18
-}).catch((err) => {
19
- console.log(`Error uploading ${fileName} to GitHub:`, err)
20
- process.exitCode = 1
21
-})
+
+let retry = true
+function uploadToGitHub () {
+ github.repos.uploadAsset(githubOpts).then(() => {
+ process.exit()
22
+ }).catch((err) => {
23
+ if (retry) {
24
+ console.log(`Error uploading ${fileName} to GitHub, will retry. Error was:`, err)
25
+ retry = false
26
+ uploadToGitHub()
27
+ } else {
28
+ console.log(`Error retrying uploading ${fileName} to GitHub:`, err)
29
+ process.exitCode = 1
30
+ }
31
+ })
32
+}
33
34
+uploadToGitHub()
0 commit comments