-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.ts
41 lines (35 loc) · 834 Bytes
/
cli.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env -S deno
import { parse } from "./deps.ts";
import { processor } from "./mod.ts";
const main = async () => {
const _cwd = Deno.cwd();
const _args = parse(Deno.args);
try {
const { output: procOutput, error: procError } = await processor({
pwd: _cwd,
filename: _args.i ||
_args.input ||
_args._.filter((inp: string | number) =>
inp.toString().endsWith(".yaml")
)[0] ||
"runner.yaml",
output: {
pretty: _args.pretty,
noColor: _args.noColor,
prefix: _args.prefix,
},
});
if (procOutput) {
console.log();
console.log(procOutput);
}
if (procError) {
console.error(procError);
}
Deno.exit(0);
} catch (error) {
console.error(error);
Deno.exit(1);
}
};
await main();