regime/bin/regime
2026-05-07 14:03:54 +02:00

30 lines
837 B
Text
Executable file

#!/usr/bin/env bun
import { resolve } from "path"
import { check } from "../src/check"
import { sync } from "../src/sync"
import { promote } from "../src/promote"
import { templates } from "../src/templates"
const [command, ...rawArgs] = process.argv.slice(2)
const hasYes = rawArgs.includes("--yes")
const hasFull = rawArgs.includes("--full")
const args = rawArgs.filter(a => a !== "--yes" && a !== "--full")
const targetDir = resolve(args[0] ?? process.cwd())
switch (command) {
case "check":
await check(targetDir, hasFull)
break
case "sync":
await sync(targetDir)
break
case "promote":
await promote(targetDir, hasYes)
break
case "templates":
templates(hasFull)
break
default:
console.error("Usage: regime <check|sync|promote|templates> [path] [--yes] [--full]")
process.exit(1)
}