@tedbrain/vlink 0.1.162 → 0.1.163
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 +50 -3
- package/package.json +1 -1
package/binaries.json
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.
|
|
2
|
+
"version": "0.1.163",
|
|
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/6b2c8e0f510b49aea2bf/?dl=1",
|
|
6
|
+
"sha256": "374f0b73dc77bfb4d62177aef3183170d4abdc3bfe2c35c1cffdb20f16d72fdc",
|
|
7
|
+
"size": 24992189
|
|
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/c7167769f45f48eab40f/?dl=1",
|
|
11
|
+
"sha256": "8e14a558ba314b5e1ac51b991f7217485d1dcf36d0b476cafc117a0ad3c3d29e",
|
|
12
|
+
"size": 25721153
|
|
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/d58a9b4bd56d4126b5e4/?dl=1",
|
|
16
|
+
"sha256": "c8495261d5f572eecd34ea89ba734ed84e52c0b4830d39977f76c54f2d523547",
|
|
17
|
+
"size": 21244901
|
|
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/7067f38cec6c4aeaaa3a/?dl=1",
|
|
21
|
+
"sha256": "003c0d0e3a9cbad8c243238236f73871170b6a239ec0a14b6b0d9c24cabc3a61",
|
|
22
|
+
"size": 22357945
|
|
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/f12df3d96e394419b055/?dl=1",
|
|
26
|
+
"sha256": "ef2b2cdb2af0f98d7b0419a92df14e3dd2400d1c2c80e617ce1ae3408655220a",
|
|
27
|
+
"size": 18088501
|
|
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/1a19da6838d84561b872/?dl=1",
|
|
31
|
+
"sha256": "bdde59e39323cbd9d1f66279808330ac064728a5ca141465ebe159ebff25e6e0",
|
|
32
|
+
"size": 9820453
|
|
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/0266150d6565422eb4f3/?dl=1",
|
|
36
|
+
"sha256": "f938d49ccb905f65ba2933435357d4115d6e1a1a211c51f91b407eeda8a2330c",
|
|
37
|
+
"size": 11327785
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
package/install.js
CHANGED
|
@@ -482,9 +482,56 @@ function sha256File(filePath) {
|
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
484
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
485
|
+
function downloadFile(url, destPath, options = {}) {
|
|
486
|
+
return new Promise((resolve, reject) => {
|
|
487
|
+
const fileStream = fs.createWriteStream(destPath, { mode: 0o755 });
|
|
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
|
+
});
|
|
488
535
|
}
|
|
489
536
|
|
|
490
537
|
function verifyBinary(binaryPath) {
|
package/package.json
CHANGED