Skip to content

Commit

Permalink
create dir if it doesn't exist (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoGranstrom authored May 14, 2021
1 parent 486c22d commit 257d631
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/nimib/docs.nim
Original file line number Diff line number Diff line change
@@ -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) =
Expand Down

0 comments on commit 257d631

Please sign in to comment.