-
Notifications
You must be signed in to change notification settings - Fork 4
/
cli.ts
executable file
·41 lines (35 loc) · 1.37 KB
/
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 node
import dotenv from "dotenv";
dotenv.config({ path: ".env" });
import { error } from "./src/utils/logging.js";
import { managingCommands } from "./src/interfaces/cli/commands/managing-cmd.js";
import { offchainCommands } from "./src/interfaces/cli/commands/offchain-cmd.js";
import { configurationCommands } from "./src/interfaces/cli/commands/configuration-cmd.js";
import { daoRegistryCommands } from "./src/interfaces/cli/commands/dao-registry-cmd.js";
import { daoArtifactsCommands } from "./src/interfaces/cli/commands/dao-artifacts-cmd.js";
import { bankExtensionCommands } from "./src/interfaces/cli/commands/bank-extension-cmd.js";
import { managerCommands } from "./src/interfaces/cli/commands/manager-cmd";
import { readFile } from "fs/promises";
import { Command } from "commander";
const program = new Command();
program.version("0.0.1");
const main = async () => {
const buffer = await readFile("./package.json");
const pkg = buffer.toJSON();
program.version(pkg["version"]);
managerCommands(program);
managingCommands(program);
offchainCommands(program);
configurationCommands(program);
daoRegistryCommands(program);
daoArtifactsCommands(program);
bankExtensionCommands(program);
program
.parseAsync(process.argv)
.then(() => process.exit(0))
.catch((e) => {
error("Error:", e);
process.exit(1);
});
};
main();