do my best to prevent nuking the plugins especially dep

This commit is contained in:
2025-06-23 05:17:07 -04:00
parent 71b78bfca4
commit eba21a8021

View File

@ -38,17 +38,23 @@ function fs:clean(package)
while handle do
local name = h.uv.fs_scandir_next(handle)
if name then
if name and name ~= package.get_root().name then
queue[name] = package.get_base_dir().."/"..name
elseif name == package.get_root().name then
-- we need to ensure that there is no chance of nuking dep
goto continue
elseif name == nil then
break
else
-- if there's a single error bail out
logger:log("error", "failed to run clean uv.fs_scandir_next failed")
return
end
::continue::
end
-- keep packages that still exist
for _, pkg in ipairs(package.get_packages()) do
for _, pkg in pairs(package.get_packages()) do
queue[pkg.name] = nil
end