snapshot functionality

This commit is contained in:
Dax Raad
2025-07-01 12:06:38 -04:00
parent 33b5fe236a
commit 11d042be25
8 changed files with 234 additions and 65 deletions

View File

@@ -0,0 +1,26 @@
import { File } from "../../../file"
import { bootstrap } from "../../bootstrap"
import { cmd } from "../cmd"
import path from "path"
export const FileCommand = cmd({
command: "file",
builder: (yargs) => yargs.command(FileReadCommand).demandCommand(),
async handler() {},
})
const FileReadCommand = cmd({
command: "read <path>",
builder: (yargs) =>
yargs.positional("path", {
type: "string",
demandOption: true,
description: "File path to read",
}),
async handler(args) {
await bootstrap({ cwd: process.cwd() }, async () => {
const content = await File.read(path.resolve(args.path))
console.log(content)
})
},
})