diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-12-04 02:32:35 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-12-04 02:32:35 +0900 |
| commit | bd753e934bb7b13fbc68c49c4694de7c4530fe49 (patch) | |
| tree | 97c84d8a2a96a47a7e03eb141481baf96b310979 | |
| parent | 2477a4800d30d766d8dab5aa5dc4023399e28b1a (diff) | |
| download | nsfisis.dev-bd753e934bb7b13fbc68c49c4694de7c4530fe49.tar.gz nsfisis.dev-bd753e934bb7b13fbc68c49c4694de7c4530fe49.tar.zst nsfisis.dev-bd753e934bb7b13fbc68c49c4694de7c4530fe49.zip | |
feat(blog/nuldoc): make nuldoc not require --allow-run flag
| -rwxr-xr-x | vhosts/blog/nuldoc | 1 | ||||
| -rw-r--r-- | vhosts/blog/nuldoc-src/commands/serve.ts | 9 |
2 files changed, 2 insertions, 8 deletions
diff --git a/vhosts/blog/nuldoc b/vhosts/blog/nuldoc index 7fc7cf22..8ab893d3 100755 --- a/vhosts/blog/nuldoc +++ b/vhosts/blog/nuldoc @@ -6,6 +6,5 @@ deno run \ --allow-read="$base_dir" \ --allow-write="$base_dir" \ --allow-net="0.0.0.0:8000" \ - --allow-run="./nuldoc" \ "$base_dir/nuldoc-src/main.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, { |
