mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
test: fixed helper function to delete test directory
This commit is contained in:
parent
d34c85d580
commit
ad00eb1be2
3 changed files with 8 additions and 7 deletions
|
@ -262,7 +262,7 @@ function M.find_root(modname)
|
|||
if M.cache[modname] then
|
||||
-- check if modname is in cache
|
||||
local modpath = M.cache[modname].modpath
|
||||
if M.check_path(modname, modpath) and vim.loop.fs_stat(modpath) then
|
||||
if M.check_path(modname, modpath) and uv.fs_stat(modpath) then
|
||||
local root = modpath:gsub("/init%.lua$", ""):gsub("%.lua$", "")
|
||||
return root
|
||||
end
|
||||
|
@ -271,7 +271,7 @@ function M.find_root(modname)
|
|||
-- check for any children in the cache
|
||||
for child, entry in pairs(M.cache) do
|
||||
if child:find(modname, 1, true) == 1 then
|
||||
if M.check_path(child, entry.modpath) and vim.loop.fs_stat(entry.modpath) then
|
||||
if M.check_path(child, entry.modpath) and uv.fs_stat(entry.modpath) then
|
||||
local basename = modname:gsub("%.", "/")
|
||||
local childbase = child:gsub("%.", "/")
|
||||
local ret = entry.modpath:gsub("/init%.lua$", ""):gsub("%.lua$", "")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue