feat: improve deployment workflows
This commit is contained in:
@@ -1,14 +1,5 @@
|
||||
import { defineCommand, runMain } from "citty";
|
||||
import { db } from "./command/db";
|
||||
import { down } from "./command/down";
|
||||
import { exportCommand } from "./command/export";
|
||||
import { exec } from "./command/exec";
|
||||
import { logs } from "./command/logs";
|
||||
import { ps } from "./command/ps";
|
||||
import { restart } from "./command/restart";
|
||||
import { start } from "./command/start";
|
||||
import { stop } from "./command/stop";
|
||||
import { up } from "./command/up";
|
||||
import { createMain } from "citty";
|
||||
import { initializeCompletion, main } from "./command/main";
|
||||
import { provideContext } from "./lib/context";
|
||||
import z, { ZodError } from "zod";
|
||||
|
||||
@@ -27,27 +18,13 @@ function formatUnknownError(error: unknown): string {
|
||||
}
|
||||
}
|
||||
|
||||
const main = defineCommand({
|
||||
meta: {
|
||||
name: "kuber",
|
||||
version: "1.0.0",
|
||||
description: "Docker Compose -> K8s translation layer",
|
||||
},
|
||||
subCommands: {
|
||||
db,
|
||||
down,
|
||||
export: exportCommand,
|
||||
exec,
|
||||
logs,
|
||||
ps,
|
||||
restart,
|
||||
start,
|
||||
stop,
|
||||
up,
|
||||
},
|
||||
});
|
||||
async function run() {
|
||||
await initializeCompletion();
|
||||
const cli = createMain(main);
|
||||
await provideContext(() => cli());
|
||||
}
|
||||
|
||||
provideContext(() => runMain(main)).catch((e) => {
|
||||
run().catch((e) => {
|
||||
console.error(formatUnknownError(e));
|
||||
process.exitCode = 1;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user