Skip to content

Commit

Permalink
fix(cache): can not mkdir multilevel folder
Browse files Browse the repository at this point in the history
  • Loading branch information
iamxiaojianzheng authored and oysandvik94 committed Aug 28, 2024
1 parent 0b431fe commit 197d215
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/curl/cache.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
local M = {}
local Path = require("plenary.path")
local notify = require("curl.notifications")

---comment
---@param global boolean
Expand All @@ -21,7 +22,10 @@ local curl_cache_dir = function(custom_dir)
cache_dir = cache_dir / custom_dir ---@type Path
end

cache_dir:mkdir({ parents = true, exists_ok = true })
if vim.fn.mkdir(cache_dir:absolute(), "p") ~= 1 then
notify.error("Error creating collection: could not create directory : " .. cache_dir:absolute())
end

return cache_dir
end

Expand Down

0 comments on commit 197d215

Please sign in to comment.