aboutsummaryrefslogtreecommitdiffhomepage
path: root/nuldoc-src/command.ts
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2023-03-17 01:02:05 +0900
committernsfisis <nsfisis@gmail.com>2023-03-17 01:02:09 +0900
commit7efa36cee6a589976745a1fe1ad15d3f7c06762b (patch)
tree795cb8f2efcffdf9a36629cda62fcf45f10df4e2 /nuldoc-src/command.ts
parent0d11c3265aa66bd5f7c207cb00c10f9ded29e851 (diff)
downloadblog.nsfisis.dev-7efa36cee6a589976745a1fe1ad15d3f7c06762b.tar.gz
blog.nsfisis.dev-7efa36cee6a589976745a1fe1ad15d3f7c06762b.tar.zst
blog.nsfisis.dev-7efa36cee6a589976745a1fe1ad15d3f7c06762b.zip
fix(nuldoc): fail to output files if destination directory does not exist
Diffstat (limited to 'nuldoc-src/command.ts')
-rw-r--r--nuldoc-src/command.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/nuldoc-src/command.ts b/nuldoc-src/command.ts
index d07f262..70532d4 100644
--- a/nuldoc-src/command.ts
+++ b/nuldoc-src/command.ts
@@ -85,7 +85,7 @@ async function outputPosts(posts: Document[], config: Config) {
post.sourceFilePath.replace(contentDir, destDir).replace(".xml", ""),
"index.html",
);
- ensureDir(dirname(destFilePath));
+ await ensureDir(dirname(destFilePath));
await writeHtmlFile(post, destFilePath);
}
}
@@ -106,7 +106,7 @@ async function outputPostList(postList: Document, config: Config) {
const cwd = Deno.cwd();
const destDir = join(cwd, config.locations.destDir);
const destFilePath = join(destDir, "posts", "index.html");
- ensureDir(dirname(destFilePath));
+ await ensureDir(dirname(destFilePath));
await writeHtmlFile(postList, destFilePath);
}
@@ -167,7 +167,7 @@ async function outputTags(tagDocs: [string, Document][], config: Config) {
const destDir = join(cwd, config.locations.destDir);
for (const [tag, tagDoc] of tagDocs) {
const destFilePath = join(destDir, "tags", tag, "index.html");
- ensureDir(dirname(destFilePath));
+ await ensureDir(dirname(destFilePath));
await writeHtmlFile(tagDoc, destFilePath);
}
}