mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: game archive mounting
This commit is contained in:
1 parent
15b6ff43c5
commit
adc1791f56
3 files changed
+39
-40
No files matched your search
@@ -1,30 +1,25 @@
|
||||
import { readdir } from 'fs/promises';
|
||||
import { argv } from 'process';
|
||||
import { readdir } from "fs/promises";
|
||||
import { argv } from "process";
|
||||
|
||||
const WINDOWS_APPS = 'C:/Program Files/WindowsApps';
|
||||
const WINDOWS_APPS = "C:/Program Files/WindowsApps";
|
||||
const wotbPackageRegex = /7458BE2C\..+_\d+(\.\d+)+_x64__.+/;
|
||||
|
||||
const isDepot = argv.includes('--depot');
|
||||
const isManual = argv.includes('--manual');
|
||||
const isManual = argv.includes("--manual");
|
||||
|
||||
let data: string;
|
||||
let compressed: boolean;
|
||||
|
||||
if (isManual) {
|
||||
data = '../../temp/game/Data';
|
||||
compressed = true;
|
||||
} else if (isDepot) {
|
||||
const [installationVersion] = await readdir(`../../depots/444202`);
|
||||
data = `../../depots/444202/${installationVersion}/Data`;
|
||||
data = "../../temp/game/Data";
|
||||
compressed = true;
|
||||
} else {
|
||||
const directories = await readdir(WINDOWS_APPS).then((files) =>
|
||||
files.filter((file) => wotbPackageRegex.test(file)),
|
||||
files.filter((file) => wotbPackageRegex.test(file))
|
||||
);
|
||||
|
||||
if (directories.length !== 1) {
|
||||
throw new Error(
|
||||
`Expected 1 directory for WoTB Windows App, got ${directories.length}.`,
|
||||
`Expected 1 directory for WoTB Windows App, got ${directories.length}.`
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user