Skip to content

Commit

Permalink
fix(dirman): correctly create nested directory
Browse files Browse the repository at this point in the history
  • Loading branch information
champignoom committed Sep 6, 2023
1 parent 20502e5 commit 920c253
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lua/neorg/modules/core/dirman/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,12 @@ module.public = {
return false
end

-- Create the workspace directory if not already present
vim.loop.fs_mkdir(workspace, 16877)
-- Recursively create the workspace directory if not already present
local slash_pos = -1
repeat
slash_pos = workspace:find("/", slash_pos+1, true)
vim.loop.fs_mkdir(workspace:sub(0, slash_pos or -1), 16877)
until not slash_pos

-- Cache the current workspace
local current_ws = vim.deepcopy(module.private.current_workspace)
Expand Down

0 comments on commit 920c253

Please sign in to comment.