@tedbrain/vlink 0.1.161 → 0.1.162
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/binaries.json +22 -22
- package/install.js +3 -50
- package/package.json +1 -1
package/binaries.json
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.
|
|
2
|
+
"version": "0.1.162",
|
|
3
3
|
"binaries": {
|
|
4
4
|
"linux-x86_64": {
|
|
5
|
-
"url": "https://cloud.tsinghua.edu.cn/f/
|
|
6
|
-
"sha256": "
|
|
7
|
-
"size":
|
|
5
|
+
"url": "https://cloud.tsinghua.edu.cn/f/28806d4398b04f86b2cd/?dl=1",
|
|
6
|
+
"sha256": "7c6169a9fb2446438987e8e434c99af4cb760209b2327551f0b35f88893720f0",
|
|
7
|
+
"size": 24807677
|
|
8
8
|
},
|
|
9
9
|
"linux-x86_64-glibc2.17": {
|
|
10
|
-
"url": "https://cloud.tsinghua.edu.cn/f/
|
|
11
|
-
"sha256": "
|
|
12
|
-
"size":
|
|
10
|
+
"url": "https://cloud.tsinghua.edu.cn/f/0ad134b039424d01b114/?dl=1",
|
|
11
|
+
"sha256": "ce5510d2932bc03f7da80624aab84a8222068cf0dfe4c0feb026b8728d736c25",
|
|
12
|
+
"size": 25529721
|
|
13
13
|
},
|
|
14
14
|
"linux-aarch64": {
|
|
15
|
-
"url": "https://cloud.tsinghua.edu.cn/f/
|
|
16
|
-
"sha256": "
|
|
17
|
-
"size":
|
|
15
|
+
"url": "https://cloud.tsinghua.edu.cn/f/1971610875924db4b176/?dl=1",
|
|
16
|
+
"sha256": "1b5a7ad7996f52f032290dcc7a68b6ba3b4775f0f25c56692b2aabd29f77c2e9",
|
|
17
|
+
"size": 21113645
|
|
18
18
|
},
|
|
19
19
|
"macos-x86_64": {
|
|
20
|
-
"url": "https://cloud.tsinghua.edu.cn/f/
|
|
21
|
-
"sha256": "
|
|
22
|
-
"size":
|
|
20
|
+
"url": "https://cloud.tsinghua.edu.cn/f/9a1be749932f45769d4a/?dl=1",
|
|
21
|
+
"sha256": "d775b4e5ec4b83a3231421868ac1cc9c7bf163fec5c6a665995b1e784d9f8924",
|
|
22
|
+
"size": 22185609
|
|
23
23
|
},
|
|
24
24
|
"macos-aarch64": {
|
|
25
|
-
"url": "https://cloud.tsinghua.edu.cn/f/
|
|
26
|
-
"sha256": "
|
|
27
|
-
"size":
|
|
25
|
+
"url": "https://cloud.tsinghua.edu.cn/f/594358ec14ac4fc09ce3/?dl=1",
|
|
26
|
+
"sha256": "64116b5fc377629bc05ff1d2ff7a4dccb2f817b2c474cd7745c475a5b13b79e8",
|
|
27
|
+
"size": 17972709
|
|
28
28
|
},
|
|
29
29
|
"windows-x86_64.exe": {
|
|
30
|
-
"url": "https://cloud.tsinghua.edu.cn/f/
|
|
31
|
-
"sha256": "
|
|
32
|
-
"size":
|
|
30
|
+
"url": "https://cloud.tsinghua.edu.cn/f/aa5b9c3d1e7d4f43bbdb/?dl=1",
|
|
31
|
+
"sha256": "ffb28876ed49b0ee1d0d2c0514b8da892ccd2a47d08068dd221d79e9922b08c7",
|
|
32
|
+
"size": 9775397
|
|
33
33
|
},
|
|
34
34
|
"windows-aarch64.exe": {
|
|
35
|
-
"url": "https://cloud.tsinghua.edu.cn/f/
|
|
36
|
-
"sha256": "
|
|
37
|
-
"size":
|
|
35
|
+
"url": "https://cloud.tsinghua.edu.cn/f/8ffd00a6b6f44aab90c0/?dl=1",
|
|
36
|
+
"sha256": "b4a37128ab2ab3b5362a092e1da6042c41662432b309e6494a63464d8e840bed",
|
|
37
|
+
"size": 11270441
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
package/install.js
CHANGED
|
@@ -482,56 +482,9 @@ function sha256File(filePath) {
|
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
484
|
|
|
485
|
-
function downloadFile(url, destPath, options = {}) {
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
const finish = () => {
|
|
490
|
-
fileStream.close((closeErr) => {
|
|
491
|
-
if (closeErr) reject(closeErr);
|
|
492
|
-
else resolve();
|
|
493
|
-
});
|
|
494
|
-
};
|
|
495
|
-
|
|
496
|
-
const request = (target, redirects) => {
|
|
497
|
-
const transport = target.startsWith('https:') ? https : http;
|
|
498
|
-
const req = transport.get(
|
|
499
|
-
target,
|
|
500
|
-
{
|
|
501
|
-
agent: requestAgent(target, options),
|
|
502
|
-
headers: { 'user-agent': `${PKG.name}/${PKG.version}` }
|
|
503
|
-
},
|
|
504
|
-
(res) => {
|
|
505
|
-
if (
|
|
506
|
-
res.statusCode >= 300 &&
|
|
507
|
-
res.statusCode < 400 &&
|
|
508
|
-
res.headers.location &&
|
|
509
|
-
redirects < 5
|
|
510
|
-
) {
|
|
511
|
-
res.resume();
|
|
512
|
-
const next = new URL(res.headers.location, target).toString();
|
|
513
|
-
return request(next, redirects + 1);
|
|
514
|
-
}
|
|
515
|
-
if (res.statusCode !== 200) {
|
|
516
|
-
res.resume();
|
|
517
|
-
return reject(
|
|
518
|
-
new VlinkInstallError(
|
|
519
|
-
`download failed: HTTP ${res.statusCode} from ${displayUrl(target)}`
|
|
520
|
-
)
|
|
521
|
-
);
|
|
522
|
-
}
|
|
523
|
-
res.pipe(fileStream);
|
|
524
|
-
}
|
|
525
|
-
);
|
|
526
|
-
|
|
527
|
-
req.on('error', reject);
|
|
528
|
-
req.setTimeout(downloadTimeoutMs(), () => req.destroy(new VlinkInstallError('download timed out')));
|
|
529
|
-
};
|
|
530
|
-
|
|
531
|
-
fileStream.on('finish', finish);
|
|
532
|
-
fileStream.on('error', reject);
|
|
533
|
-
request(url, 0);
|
|
534
|
-
});
|
|
485
|
+
async function downloadFile(url, destPath, options = {}) {
|
|
486
|
+
const response = await httpResponse(url, downloadTimeoutMs(), options);
|
|
487
|
+
await pipeline(response, fs.createWriteStream(destPath, { mode: 0o755 }));
|
|
535
488
|
}
|
|
536
489
|
|
|
537
490
|
function verifyBinary(binaryPath) {
|
package/package.json
CHANGED