allow remove() of non-existent files

This commit is contained in:
Grump
2020-05-08 10:16:51 +02:00
parent f97d0d60b6
commit e9a059b84c

View File

@@ -452,6 +452,9 @@ end
function nativefs.remove(name)
local info = nativefs.getInfo(name)
if not info then
return false, "Could not remove " .. name
end
if info.type == 'directory' then
if not rmdir(name) then
return false, "Could not remove directory " .. name