Files
blitzkit/packages/scripts/src/vfs/index.ts
T
2026-10-25 12:50:48 -05:00

24 lines
544 B
TypeScript

import { vfs } from "./vfs";
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);
}
} else if (command === "yaml") {
const content = await vfs.yaml(path);
await Bun.write(Bun.stdout, JSON.stringify(content, null, 2));
}