dprint 0.32.2 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/info.json +6 -6
- package/install_api.js +19 -1
- package/package.json +1 -1
package/info.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.33.0",
|
|
3
3
|
"checksums": {
|
|
4
|
-
"windows-x86_64": "
|
|
5
|
-
"darwin-x86_64": "
|
|
6
|
-
"darwin-aarch64": "
|
|
7
|
-
"linux-x86_64": "
|
|
8
|
-
"linux-aarch64": "
|
|
4
|
+
"windows-x86_64": "98d3e6616e23cb9b2a969975b9c34b4b571e40725b0348d19cebedcb9c584be5",
|
|
5
|
+
"darwin-x86_64": "d4b502bb00bd4e3e19657092648883e8d8270de32f61a0ff78af7709dc70b9b2",
|
|
6
|
+
"darwin-aarch64": "df3a99c68d7229125040e720990d70fcec0e16b64e7ccba266f5771e2e9e7edd",
|
|
7
|
+
"linux-x86_64": "77c52e21df129e96a7860163029e267f38e705bc7be014b79668ad15f6e0c8e2",
|
|
8
|
+
"linux-aarch64": "9762ae7b175d68d853daed32a17580b0662a3a46402053d1770ee6e7f355b2e5"
|
|
9
9
|
}
|
|
10
10
|
}
|
package/install_api.js
CHANGED
|
@@ -34,7 +34,7 @@ function install() {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// now try to download it
|
|
37
|
-
return
|
|
37
|
+
return downloadZipFileWithRetries(url).then(() => {
|
|
38
38
|
verifyZipChecksum();
|
|
39
39
|
return extractZipFile().then(() => {
|
|
40
40
|
// todo: how to just +x? does it matter?
|
|
@@ -75,6 +75,24 @@ function install() {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
function downloadZipFileWithRetries(url) {
|
|
79
|
+
/** @param remaining {number} */
|
|
80
|
+
function download(remaining) {
|
|
81
|
+
return downloadZipFile(url)
|
|
82
|
+
.catch(err => {
|
|
83
|
+
if (remaining === 0) {
|
|
84
|
+
return Promise.reject(err);
|
|
85
|
+
} else {
|
|
86
|
+
console.error("Error downloading dprint zip file.", err);
|
|
87
|
+
console.error("Retrying download (remaining: " + remaining + ")");
|
|
88
|
+
return download(remaining - 1);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return download(3);
|
|
94
|
+
}
|
|
95
|
+
|
|
78
96
|
function downloadZipFile(url) {
|
|
79
97
|
return new Promise((resolve, reject) => {
|
|
80
98
|
https.get(url, function(response) {
|