diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-07-04 19:10:39 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-07-04 19:10:39 +0900 |
| commit | 98db243a59fb6a409b3677f2195e96da6fd39564 (patch) | |
| tree | 0d1cd151d0b6238896fee3394336c30b2cbef8fa /services/blog/nuldoc-src | |
| parent | 4ff12019835feb746c208c64a4481a8a2aa10db7 (diff) | |
| download | nsfisis.dev-98db243a59fb6a409b3677f2195e96da6fd39564.tar.gz nsfisis.dev-98db243a59fb6a409b3677f2195e96da6fd39564.tar.zst nsfisis.dev-98db243a59fb6a409b3677f2195e96da6fd39564.zip | |
feat(blog/nuldoc): add `--no-rebuild` flag to `nuldoc serve` command
Diffstat (limited to 'services/blog/nuldoc-src')
| -rw-r--r-- | services/blog/nuldoc-src/commands/serve.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/services/blog/nuldoc-src/commands/serve.ts b/services/blog/nuldoc-src/commands/serve.ts index e944aaf0..44c6f2bc 100644 --- a/services/blog/nuldoc-src/commands/serve.ts +++ b/services/blog/nuldoc-src/commands/serve.ts @@ -1,3 +1,4 @@ +import { parseArgs } from "@std/cli"; import { serveDir, STATUS_CODE, STATUS_TEXT } from "@std/http"; import { join } from "@std/path"; import { Config } from "../config.ts"; @@ -18,10 +19,15 @@ function isResourcePath(pathname: string): boolean { } export function runServeCommand(config: Config) { + const parsedArgs = parseArgs(Deno.args, { + boolean: ["no-rebuild"], + }); + + const doRebuild = !parsedArgs["no-rebuild"]; const rootDir = join(Deno.cwd(), config.locations.destDir); Deno.serve({ hostname: "127.0.0.1" }, async (req) => { const pathname = new URL(req.url).pathname; - if (!isResourcePath(pathname)) { + if (!isResourcePath(pathname) && doRebuild) { await runBuildCommand(config); console.log("rebuild"); } |
