vfs debug

This commit is contained in:
tresabhi committed 2026-10-19 20:12:03 -05:00
1 parent 1b5c79c2b8
commit 7df53d845d
3 files changed
+27 -2

No files matched your search

+2 -1
View File
@@ -10,7 +10,8 @@
"build-protos": "cd packages/scripts && bun run build-protos", "build-protos": "cd packages/scripts && bun run build-protos",
"record-performance": "cd packages/scripts && bun run record-performance", "record-performance": "cd packages/scripts && bun run record-performance",
"download-client": "cd packages/scripts && bun run download-client", "download-client": "cd packages/scripts && bun run download-client",
"clean-astro": "rm -rf packages/website/.astro packages/website/node_modules/.astro packages/website/node_modules/.vite" "clean-astro": "rm -rf packages/website/.astro packages/website/node_modules/.astro packages/website/node_modules/.vite",
"vfs": "cd packages/scripts && bun run vfs"
}, },
"type": "module", "type": "module",
"workspaces": [ "workspaces": [
+2 -1
View File
@@ -5,7 +5,8 @@
"discover-ids": "bun src/discoverIds/index.ts", "discover-ids": "bun src/discoverIds/index.ts",
"build-protos": "bun src/protos.ts", "build-protos": "bun src/protos.ts",
"record-performance": "bun src/recordPerformance/index.ts", "record-performance": "bun src/recordPerformance/index.ts",
"download-client": "bun src/downloadClient/index.ts" "download-client": "bun src/downloadClient/index.ts",
"vfs": "bun src/vfs/index.ts"
}, },
"dependencies": { "dependencies": {
"@blitzkit/closed": "workspace:*", "@blitzkit/closed": "workspace:*",
+23
View File
@@ -0,0 +1,23 @@
import { assertSecret } from "@blitzkit/core";
import { LocalVFS } from "@blitzkit/core/src/blitzkit/vfs/local";
export const vfs = new LocalVFS(assertSecret(import.meta.env.CLIENT_DIR));
const command = Bun.argv[2];
const path = Bun.argv[3];
if (!path) {
console.error("Gimme a path to assess dumb ass");
process.exit(1);
}
if (command === "cat") {
const content = await vfs.file(path);
await Bun.write(Bun.stdout, content);
} else if (command === "ls") {
const files = await vfs.dir(path);
for (const file of files) {
console.log(file);
}
}