-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.ts
executable file
·25 lines (22 loc) · 838 Bytes
/
run.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env -S deno run --allow-write --allow-read --allow-run
import { Args } from "https://deno.land/[email protected]/flags/mod.ts";
import {
Info,
Commands,
GitHooks,
Runner,
} from "https://raw.githubusercontent.com/zored/deno/v0.0.84/mod.ts";
import { DepChecker } from "https://raw.githubusercontent.com/zored/deno/v0.0.84/src/lib/dep-check.ts";
const { cwd } = Deno;
const info = () => new Info().updateFiles(["README.md"]);
const fmt = () => new Runner().run(`deno fmt ./run.ts`);
const lint = () => new Runner().run(`/usr/local/bin//ktlint`)
const arch = () => new DepChecker().byPaths(cwd(), cwd() + "/dep-check.json");
const gitHooks = new GitHooks({
"pre-commit": () => {
info();
arch();
},
});
const hooks = (args: Args) => gitHooks.run(args);
new Commands({ info, fmt, hooks, arch, lint }).runAndExit();