From 47cb0f36f95fc09672d4df2cbd1b30e5a26cf1f2 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sun, 8 Nov 2026 18:10:00 -0600 Subject: [PATCH] download wg parts --- packages/scripts/src/downloadClient/wgc/index.ts | 11 +++++++---- packages/scripts/src/downloadClient/wgpkg.ts | 4 ++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/scripts/src/downloadClient/wgc/index.ts b/packages/scripts/src/downloadClient/wgc/index.ts index 6b1637c79..2cb0a1ef3 100644 --- a/packages/scripts/src/downloadClient/wgc/index.ts +++ b/packages/scripts/src/downloadClient/wgc/index.ts @@ -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); - 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); } diff --git a/packages/scripts/src/downloadClient/wgpkg.ts b/packages/scripts/src/downloadClient/wgpkg.ts index c9f223e9b..6c3f2b239 100644 --- a/packages/scripts/src/downloadClient/wgpkg.ts +++ b/packages/scripts/src/downloadClient/wgpkg.ts @@ -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 });