summaryrefslogtreecommitdiffhomepage
path: root/services/blog/nuldoc-src/main.ts
blob: af6acc2efabce7150b3be4018d8b46571c988b05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { runBuildCommand } from "./commands/build.ts";
import { runNewCommand } from "./commands/new.ts";
import { runServeCommand } from "./commands/serve.ts";
import { getDefaultConfigPath, loadConfig } from "./config.ts";

const config = await loadConfig(getDefaultConfigPath());

if (import.meta.main) {
  const command = Deno.args[0] ?? "build";
  if (command === "build") {
    await runBuildCommand(config);
  } else if (command === "new") {
    runNewCommand(config);
  } else if (command === "serve") {
    runServeCommand(config);
  } else {
    console.error(`Unknown command: ${command}`);
  }
}