From 7efa36cee6a589976745a1fe1ad15d3f7c06762b Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 17 Mar 2023 01:02:05 +0900 Subject: fix(nuldoc): fail to output files if destination directory does not exist --- nuldoc-src/command.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'nuldoc-src') 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); } } -- cgit v1.2.3-70-g09d2