summaryrefslogtreecommitdiffhomepage
path: root/script/format.ts
diff options
context:
space:
mode:
Diffstat (limited to 'script/format.ts')
-rwxr-xr-xscript/format.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/script/format.ts b/script/format.ts
new file mode 100755
index 000000000..d80820409
--- /dev/null
+++ b/script/format.ts
@@ -0,0 +1,13 @@
+#!/usr/bin/env bun
+
+import { $ } from "bun"
+
+await $`bun run prettier --ignore-unknown --write $(git ls-files)`
+
+if (process.env["CI"] && (await $`git status --porcelain`.text())) {
+ await $`git config --local user.email "[email protected]"`
+ await $`git config --local user.name "GitHub Action"`
+ await $`git add -A`
+ await $`git commit -m "chore: format code"`
+ await $`git push`
+}