mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-09 18:56:11 +01:00
24 lines
544 B
TypeScript
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));
|
|
}
|