From bd753e934bb7b13fbc68c49c4694de7c4530fe49 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 4 Dec 2024 02:32:35 +0900 Subject: feat(blog/nuldoc): make nuldoc not require --allow-run flag --- vhosts/blog/nuldoc-src/commands/serve.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'vhosts/blog/nuldoc-src/commands/serve.ts') diff --git a/vhosts/blog/nuldoc-src/commands/serve.ts b/vhosts/blog/nuldoc-src/commands/serve.ts index 5fe8a6f9..cc8d5d5b 100644 --- a/vhosts/blog/nuldoc-src/commands/serve.ts +++ b/vhosts/blog/nuldoc-src/commands/serve.ts @@ -2,19 +2,14 @@ import { serveDir } from "std/http/file_server.ts"; import { STATUS_CODE, STATUS_TEXT } from "std/http/mod.ts"; import { join } from "std/path/mod.ts"; import { Config } from "../config.ts"; +import { runBuildCommand } from "./build.ts"; export function runServeCommand(config: Config) { const rootDir = join(Deno.cwd(), config.locations.destDir); Deno.serve(async (req) => { const pathname = new URL(req.url).pathname; if (!pathname.endsWith("css") && !pathname.endsWith("svg")) { - const command = new Deno.Command( - join(Deno.cwd(), "nuldoc"), - { - args: ["build"], - }, - ); - await command.output(); + await runBuildCommand(config); console.log("rebuild"); } const res = await serveDir(req, { -- cgit v1.2.3-70-g09d2