opencode_offline/script/format.ts

14 lines
385 B
TypeScript
Raw Normal View History

2025-09-10 11:47:47 +08:00
#!/usr/bin/env bun
import { $ } from "bun"
2025-09-27 14:22:03 +08:00
await $`bun run prettier --ignore-unknown --write`
2025-09-10 11:47:47 +08:00
if (process.env["CI"] && (await $`git status --porcelain`.text())) {
await $`git config --local user.email "action@github.com"`
await $`git config --local user.name "GitHub Action"`
await $`git add -A`
await $`git commit -m "chore: format code"`
2025-09-10 11:49:35 +08:00
await $`git push --no-verify`
2025-09-10 11:47:47 +08:00
}