mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 03:29:51 +02:00
feat: implement all methods
This commit is contained in:
1 parent
f33a73e1bb
commit
9ffc040723
5 files changed
+134
-102
No files matched your search
@@ -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;
|
||||
Reference in new issue
Block a user