Skip to content

Commit

Permalink
feat: skip dir create for non strings (issue: #84)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robitx committed Dec 20, 2023
1 parent cc1e0c2 commit 567fe21
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lua/gp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -728,13 +728,13 @@ M.setup = function(opts)

-- make sure _dirs exists
for k, v in pairs(M.config) do
-- strip trailing slash
if k:match("_dir$") and type(v) == "string" then
M.config[k] = v:gsub("/$", "")
end
if k:match("_dir$") and vim.fn.isdirectory(v) == 0 then
M.info("creating directory " .. v)
vim.fn.mkdir(v, "p")
local dir = v:gsub("/$", "")
M.config[k] = dir
if vim.fn.isdirectory(dir) == 0 then
M.info("creating directory " .. dir)
vim.fn.mkdir(dir, "p")
end
end
end

Expand Down

0 comments on commit 567fe21

Please sign in to comment.