From 257d631f8130577e7984b3e498f27f9e0beb56b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Granstr=C3=B6m?= <5092565+HugoGranstrom@users.noreply.github.com> Date: Fri, 14 May 2021 15:17:34 +0200 Subject: [PATCH] create dir if it doesn't exist (#44) --- src/nimib/docs.nim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/nimib/docs.nim b/src/nimib/docs.nim index 8069dc40..a6694f0a 100644 --- a/src/nimib/docs.nim +++ b/src/nimib/docs.nim @@ -1,7 +1,11 @@ +import std/os import browsers import types proc write*(doc: NbDoc) = + let (dir, name, ext) = doc.filename.splitFile() + if not dir.dirExists: + createDir(dir) writeFile(doc.filename, doc.render(doc)) proc open*(doc: NbDoc) =