fetch urls

This commit is contained in:
tresabhi committed 2026-11-08 18:07:12 -06:00
1 parent cd2ef98e22
commit 7918a88666
4 files changed
+160 -3

No files matched your search

+10 -3
View File
@@ -1,31 +1,38 @@
import { assertSecret } from "@blitzkit/core";
import { mkdir, rm } from "node:fs/promises";
import { downloadSteamClient } from "./steam";
import { downloadWGCClient } from "./wgc";
import { downloadWGPKGClient } from "./wgpkg";
import { downloadZipClient } from "./zip";
export const DEPOT_DOWNLOADER_RETRY_TIME = 30_000;
const provider = assertSecret(import.meta.env.CLIENT_PROVIDER);
export const source = assertSecret(import.meta.env.CLIENT_SOURCE);
const provider = import.meta.env.CLIENT_PROVIDER;
export const source = import.meta.env.CLIENT_SOURCE;
export const dir = assertSecret(import.meta.env.CLIENT_DIR);
await rm(dir, { recursive: true, force: true });
await mkdir(dir, { recursive: true });
switch (provider) {
// steam, identical to wgc
case "steam":
await downloadSteamClient();
break;
// from zip, usually has a root directory for opentest
case "zip":
await downloadZipClient();
break;
// effectively the same as wgc, but direct for preview
case "wgpkg":
await downloadWGPKGClient();
break;
default:
throw new Error(`Unknown provider: ${provider}`);
console.log("Unknown client provider specified, using latest wgc client");
case "wgc":
await downloadWGCClient();
break;
}