Remove not empty folder (#3562)

This commit is contained in:
Robert
2017-12-25 16:07:05 +01:00
committed by GitHub
parent a16c500ac7
commit b855eff1b9

View File

@@ -430,7 +430,11 @@ function FileManager:deleteFile(file)
end
local is_doc = DocumentRegistry:getProvider(file_abs_path)
ok, err = os.remove(file_abs_path)
if lfs.attributes(file_abs_path, "mode") == "file" then
ok, err = os.remove(file_abs_path)
else
ok, err = util.purgeDir(file_abs_path)
end
if ok and err == nil then
if is_doc ~= nil then
DocSettings:open(file):purge()