diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-11-03 01:53:36 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-11-03 01:53:36 +0900 |
| commit | 02878cdd0f531cb6cdfe5177320548be357558eb (patch) | |
| tree | ed35cb637454af4c2cfe50e0e0fc3e5764405a88 /services | |
| parent | 3e6a11290795e54ee451ad7d6a06650a2846beae (diff) | |
| download | nsfisis.dev-02878cdd0f531cb6cdfe5177320548be357558eb.tar.gz nsfisis.dev-02878cdd0f531cb6cdfe5177320548be357558eb.tar.zst nsfisis.dev-02878cdd0f531cb6cdfe5177320548be357558eb.zip | |
feat(nuldoc): allow serve comand to accept site name
Diffstat (limited to 'services')
| -rw-r--r-- | services/nuldoc/nuldoc-src/commands/serve.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/services/nuldoc/nuldoc-src/commands/serve.ts b/services/nuldoc/nuldoc-src/commands/serve.ts index 6b7d8a0..8388d48 100644 --- a/services/nuldoc/nuldoc-src/commands/serve.ts +++ b/services/nuldoc/nuldoc-src/commands/serve.ts @@ -25,7 +25,12 @@ export function runServeCommand(config: Config) { }); const doRebuild = !parsedArgs["no-rebuild"]; - const rootDir = join(Deno.cwd(), config.locations.destDir); + const siteName = String(parsedArgs._[1]); + if (siteName === "") { + throw new Error("Usage: nuldoc serve <site>"); + } + + const rootDir = join(Deno.cwd(), config.locations.destDir, siteName); Deno.serve({ hostname: "127.0.0.1" }, async (req) => { const pathname = new URL(req.url).pathname; if (!isResourcePath(pathname) && doRebuild) { |
