mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-09 02:40:38 +01:00
download wg parts
This commit is contained in:
2 files changed
+11
-4
No files matched your search
@@ -6,6 +6,7 @@ import {
|
||||
WGC_METADATA_PROTOCOL_VERSION,
|
||||
WGC_PATCHES_CHAIN_PROTOCOL_VERSION,
|
||||
} from "../../config/wgcClient";
|
||||
import { downloadWgParts } from "../wgpkg";
|
||||
import { ClientMetadata, PatchesChain } from "./types";
|
||||
|
||||
const parser = new XMLParser();
|
||||
@@ -52,8 +53,10 @@ export async function downloadWGCClient() {
|
||||
.then((response) => response.text())
|
||||
.then((text) => parser.parse(text) as Promise<PatchesChain>);
|
||||
|
||||
for (const file of patchesChain.protocol.patches_chain.patch.files.file) {
|
||||
const fileUrl = new URL(file.name, patchesChain.protocol.web_seeds.url);
|
||||
console.log(`${fileUrl}`);
|
||||
}
|
||||
const urls = patchesChain.protocol.patches_chain.patch.files.file.map(
|
||||
(file) =>
|
||||
new URL(file.name, patchesChain.protocol.web_seeds.url).toString(),
|
||||
);
|
||||
|
||||
await downloadWgParts(urls);
|
||||
}
|
||||
@@ -26,6 +26,10 @@ export async function downloadWGPKGClient() {
|
||||
|
||||
console.log(`Downloading ${urls.length} packages...`);
|
||||
|
||||
await downloadWgParts(urls);
|
||||
}
|
||||
|
||||
export async function downloadWgParts(urls: string[]) {
|
||||
await rm(WGPKG_DIR, { recursive: true, force: true });
|
||||
await mkdir(WGPKG_DIR, { recursive: true });
|
||||
|
||||
|
||||
Reference in new issue
Block a user