Remove not empty folder (#3562)

pull/3563/head
Robert 6 years ago committed by GitHub
parent a16c500ac7
commit b855eff1b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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()

Loading…
Cancel
Save