-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathmain.ts
executable file
·31 lines (27 loc) · 979 Bytes
/
main.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
#!/usr/bin/env -S deno run -A
// @deno-types="../scripts/dist/fabric-template-generator.d.ts"
import * as generator from "../scripts/dist/fabric-template-generator.js";
import {
Command,
CompletionsCommand,
} from "https://deno.land/x/[email protected]/command/mod.ts";
import { initCommand } from "./commands/init.ts";
import { upgradeCommand } from "./commands/upgrade.ts";
// Replaced by esbuild.
declare let __VERSION__: string;
const VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : "dev";
if (import.meta.main) {
const cmd = new Command()
.name("Fabric CLI tools")
.version(VERSION)
.description("A set of command line tools to aid Fabric mod development")
.action(() => {
// Show the help in the default command with no args.
cmd.showHelp();
Deno.exit(0);
})
.command("init", initCommand())
.command("upgrade", upgradeCommand())
.command("completions", new CompletionsCommand());
await cmd.parse();
}