mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-19 20:03:51 +01:00
add zip vfs
This commit is contained in:
4 files changed
+24
-9
No files matched your search
@@ -0,0 +1,18 @@
|
|||||||
|
import { assertSecret } from "@blitzkit/core";
|
||||||
|
import { LocalVFS } from "./local";
|
||||||
|
import { MixedVFS } from "./mixed";
|
||||||
|
import { ZipVFS } from "./zip";
|
||||||
|
|
||||||
|
// zip reads straight from the remote archive; CLIENT_DIR stays first so SmartDLC patches override it
|
||||||
|
export function createClientVFS() {
|
||||||
|
const local = new LocalVFS(assertSecret(import.meta.env.CLIENT_DIR));
|
||||||
|
|
||||||
|
if (import.meta.env.CLIENT_PROVIDER === "zip") {
|
||||||
|
return new MixedVFS([
|
||||||
|
local,
|
||||||
|
new ZipVFS(assertSecret(import.meta.env.CLIENT_SOURCE)),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return local;
|
||||||
|
}
|
||||||
@@ -3,7 +3,6 @@ import { mkdir, rm } from "node:fs/promises";
|
|||||||
import { downloadSteamClient } from "./steam";
|
import { downloadSteamClient } from "./steam";
|
||||||
import { downloadWGCClient } from "./wgc";
|
import { downloadWGCClient } from "./wgc";
|
||||||
import { downloadWGPKGClient } from "./wgpkg";
|
import { downloadWGPKGClient } from "./wgpkg";
|
||||||
import { downloadZipClient } from "./zip";
|
|
||||||
|
|
||||||
export const DEPOT_DOWNLOADER_RETRY_TIME = 30_000;
|
export const DEPOT_DOWNLOADER_RETRY_TIME = 30_000;
|
||||||
|
|
||||||
@@ -20,9 +19,9 @@ switch (provider) {
|
|||||||
await downloadSteamClient();
|
await downloadSteamClient();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// from zip, usually has a root directory for opentest
|
// from zip, read remotely by ZipVFS at build time; nothing to download
|
||||||
case "zip":
|
case "zip":
|
||||||
await downloadZipClient();
|
console.log("Zip client provider; skipping download in favor of ZipVFS");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// effectively the same as wgc, but direct for preview
|
// effectively the same as wgc, but direct for preview
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { assertSecret } from "@blitzkit/core";
|
import { createClientVFS } from "@blitzkit/core/src/blitzkit/vfs/client";
|
||||||
import { LocalVFS } from "@blitzkit/core/src/blitzkit/vfs/local";
|
|
||||||
|
|
||||||
export const vfs = new LocalVFS(assertSecret(import.meta.env.CLIENT_DIR));
|
export const vfs = createClientVFS();
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
import { assertSecret } from "@blitzkit/core";
|
import { createClientVFS } from "@blitzkit/core/src/blitzkit/vfs/client";
|
||||||
import { LocalVFS } from "@blitzkit/core/src/blitzkit/vfs/local";
|
|
||||||
|
|
||||||
export const vfs = new LocalVFS(assertSecret(import.meta.env.CLIENT_DIR));
|
export const vfs = createClientVFS();
|
||||||
Reference in new issue
Block a user