From 29bcdc6c1bad2240d404de9dca2463e46fdc1e93 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 17 Mar 2023 02:10:54 +0900 Subject: refactor: split command.ts --- nuldoc-src/main.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'nuldoc-src/main.ts') diff --git a/nuldoc-src/main.ts b/nuldoc-src/main.ts index c7c175b..1635d76 100644 --- a/nuldoc-src/main.ts +++ b/nuldoc-src/main.ts @@ -1,6 +1,14 @@ +import { runBuildCommand } from "./commands/build.ts"; +import { runServeCommand } from "./commands/serve.ts"; import { config } from "./config.ts"; -import { run } from "./command.ts"; if (import.meta.main) { - await run(Deno.args[0] ?? "build", config); + const command = Deno.args[0] ?? "build"; + if (command === "build") { + await runBuildCommand(config); + } else if (command === "serve") { + runServeCommand(config); + } else { + console.error(`Unknown command: ${command}`); + } } -- cgit v1.2.3-70-g09d2