dprint 0.34.0 → 0.34.1
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/bin.js +5 -1
- package/info.json +7 -7
- package/install_api.js +16 -11
- package/package.json +1 -1
package/bin.js
CHANGED
|
@@ -10,7 +10,11 @@ const exePath = path.join(__dirname, os.platform() === "win32" ? "dprint.exe" :
|
|
|
10
10
|
|
|
11
11
|
if (!fs.existsSync(exePath)) {
|
|
12
12
|
require("./install_api").runInstall().then(() => {
|
|
13
|
-
|
|
13
|
+
// I'm not sure why (I think due zip extraction), but the executable
|
|
14
|
+
// doesn't seem fully ready unless waiting for the next tick
|
|
15
|
+
setTimeout(() => {
|
|
16
|
+
runDprintExe();
|
|
17
|
+
}, 0);
|
|
14
18
|
}).catch(err => {
|
|
15
19
|
console.error(err);
|
|
16
20
|
process.exit(1);
|
package/info.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.34.
|
|
2
|
+
"version": "0.34.1",
|
|
3
3
|
"checksums": {
|
|
4
|
-
"windows-x86_64": "
|
|
5
|
-
"darwin-x86_64": "
|
|
6
|
-
"darwin-aarch64": "
|
|
7
|
-
"linux-x86_64-gnu": "
|
|
8
|
-
"linux-x86_64-musl": "
|
|
9
|
-
"linux-aarch64": "
|
|
4
|
+
"windows-x86_64": "a3a06a8d1a6a2801db11c605b603401c0e5ba8dbc0e65a55c666bdd89fbecddc",
|
|
5
|
+
"darwin-x86_64": "b7d1a456d34cffcf010820e3986b3ebd5d22614556a532dc57f4a25ed8bab6a1",
|
|
6
|
+
"darwin-aarch64": "1aae5c10fcdf4e554b8e75a0e2992eac731e15b8de0d9a2f6ed77d26524e5d5f",
|
|
7
|
+
"linux-x86_64-gnu": "43dd4bab71f3a70738670ef51f1e54c84b89405d9dfe5bec6ae5199ca20c93fe",
|
|
8
|
+
"linux-x86_64-musl": "dd5833178a7986acaeea8abbac687754f3ee7ce39371ac55c3e17113938027c9",
|
|
9
|
+
"linux-aarch64": "105c982071ae43c1e207231cd1516f714d29efd79d050f4415e3707d3baecd54"
|
|
10
10
|
}
|
|
11
11
|
}
|
package/install_api.js
CHANGED
|
@@ -26,7 +26,7 @@ function install() {
|
|
|
26
26
|
const zipFilePath = path.join(__dirname, "dprint.zip");
|
|
27
27
|
|
|
28
28
|
const target = getTarget();
|
|
29
|
-
const
|
|
29
|
+
const downloadUrl = "https://github.com/dprint/dprint/releases/download/"
|
|
30
30
|
+ info.version
|
|
31
31
|
+ "/dprint-" + target + ".zip";
|
|
32
32
|
|
|
@@ -38,7 +38,7 @@ function install() {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
// now try to download it
|
|
41
|
-
return downloadZipFileWithRetries(
|
|
41
|
+
return downloadZipFileWithRetries(downloadUrl).then(() => {
|
|
42
42
|
verifyZipChecksum();
|
|
43
43
|
return extractZipFile().then(() => {
|
|
44
44
|
// todo: how to just +x? does it matter?
|
|
@@ -130,18 +130,23 @@ function install() {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
function getProxyUrl(requestUrl) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
if (typeof process.env.NO_PROXY === "string") {
|
|
138
|
-
const noProxyAddresses = process.env.NO_PROXY.split(",");
|
|
139
|
-
const host = url.parse(requestUrl).host;
|
|
140
|
-
if (noProxyAddresses.indexOf(host) >= 0) {
|
|
133
|
+
try {
|
|
134
|
+
const proxyUrl = process.env.HTTPS_PROXY || process.env.HTTP_PROXY;
|
|
135
|
+
if (typeof proxyUrl !== "string" || proxyUrl.length === 0) {
|
|
141
136
|
return undefined;
|
|
142
137
|
}
|
|
138
|
+
if (typeof process.env.NO_PROXY === "string") {
|
|
139
|
+
const noProxyAddresses = process.env.NO_PROXY.split(",");
|
|
140
|
+
const host = url.parse(requestUrl).host;
|
|
141
|
+
if (noProxyAddresses.indexOf(host) >= 0) {
|
|
142
|
+
return undefined;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return proxyUrl;
|
|
146
|
+
} catch (err) {
|
|
147
|
+
console.error("[dprint]: Error getting proxy url.", err);
|
|
148
|
+
return undefined;
|
|
143
149
|
}
|
|
144
|
-
return proxyUrl;
|
|
145
150
|
}
|
|
146
151
|
|
|
147
152
|
function verifyZipChecksum() {
|