feat: implement all methods

This commit is contained in:
TrèsAbhi committed 2025-11-29 15:16:09 -06:00
1 parent f33a73e1bb
commit 9ffc040723
5 files changed
+134 -102

No files matched your search

+26 -9
View File
@@ -1,12 +1,29 @@
import { assertSecret } from "@blitzkit/core";
import { SteamVFS } from "../core/vfs/vfs";
import { AbstractVFS } from "../core/vfs/abstract";
import { SteamVFS } from "../core/vfs/steam";
import { ZipVFS } from "../core/vfs/zip";
const APP = 444200;
const DEPOT = 444202;
const source = Bun.argv
.find((arg) => arg.startsWith("--source="))
?.split("=")[1];
export const vfs = await new SteamVFS(
assertSecret(import.meta.env.STEAM_USERNAME),
assertSecret(import.meta.env.STEAM_PASSWORD),
APP,
DEPOT
).init();
let resolved: AbstractVFS;
if (source === "steam") {
const APP = 444200;
const DEPOT = 444202;
resolved = await new SteamVFS(
assertSecret(import.meta.env.STEAM_USERNAME),
assertSecret(import.meta.env.STEAM_PASSWORD),
APP,
DEPOT
).init();
} else if (source === "zip") {
const url = assertSecret(import.meta.env.ZIP_URL);
resolved = await new ZipVFS(url).init();
} else {
throw new Error("No valid source specified");
}
export const vfs = resolved;