mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
vfs debug
This commit is contained in:
1 parent
1b5c79c2b8
commit
7df53d845d
3 files changed
+27
-2
No files matched your search
@@ -5,7 +5,8 @@
|
||||
"discover-ids": "bun src/discoverIds/index.ts",
|
||||
"build-protos": "bun src/protos.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": {
|
||||
"@blitzkit/closed": "workspace:*",
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user