Files
blitzkit/packages/scripts/src/vfs/index.ts
T

23 lines
544 B
TypeScript
Raw Normal View History

2026-10-25 12:27:57 -05:00
import { vfs } from "./vfs";
2026-10-19 20:12:03 -05:00
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);
}
2026-10-25 12:50:48 -05:00
} else if (command === "yaml") {
const content = await vfs.yaml(path);
await Bun.write(Bun.stdout, JSON.stringify(content, null, 2));
2026-10-19 20:12:03 -05:00
}