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 CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "0.32.2",
2
+ "version": "0.33.0",
3
3
  "checksums": {
4
- "windows-x86_64": "e4c0916438a11b18b1d6a3ce7c4e23f18998648d39247fa0b617c9863dea6d11",
5
- "darwin-x86_64": "5abcc7e2f99b98a629b73ded47ca84bc851b4f6ec35ff6df496c2eefd569c55c",
6
- "darwin-aarch64": "ec909acfc179b064e7d19e130c1aa1bdf0350d929b9a04dc6f6b5ce84432eb69",
7
- "linux-x86_64": "8e8d0f32e5522a61f6251fb3b9c6be106584ccdfdb13008b276c1ee8bfdc6ffa",
8
- "linux-aarch64": "ddff520568958b6dfeac83105a913db7247188035a0e1af12d4100d0c0d631e4"
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 downloadZipFile(url).then(() => {
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dprint",
3
- "version": "0.32.2",
3
+ "version": "0.33.0",
4
4
  "description": "Pluggable and configurable code formatting platform written in Rust.",
5
5
  "bin": "bin.js",
6
6
  "scripts": {