Skip to content

Commit

Permalink
Create homeDir if it doesn't exist alredy (#246)
Browse files Browse the repository at this point in the history
* create home dir if it doesn't exist alredy

* log `nb.homeDir` creation
  • Loading branch information
neroist authored Jul 10, 2024
1 parent 4af79ac commit 5454182
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/nimib.nim
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ template nbInit*(theme = themes.useDefault, backend = renders.useHtmlBackend, th
log "filename: " & nb.filename

if nb.cfg.homeDir != "":
if not dirExists(nb.homeDir):
log "creating nb.homeDir: " & $nb.homeDir
createDir(nb.homeDir)

log "setting current directory to nb.homeDir: " & $nb.homeDir

setCurrentDir nb.homeDir

# can be overriden by theme, but it is better to initialize this anyway
Expand Down

0 comments on commit 5454182

Please sign in to comment.