aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2022-12-03 16:21:18 -0500
committerAdam Harrison <adamdharrison@gmail.com>2022-12-03 16:21:18 -0500
commitbc2a5b75bc203fc30c31cf8ac3caceba6a8fd041 (patch)
treeab9f05ef1119a003fbdd46c25c5df704938a0d6d
parent3af5bc2df5b865dcc6770d1b8ee4c8c4c6aa959f (diff)
downloadlite-xl-plugin-manager-bc2a5b75bc203fc30c31cf8ac3caceba6a8fd041.tar.gz
lite-xl-plugin-manager-bc2a5b75bc203fc30c31cf8ac3caceba6a8fd041.zip
Unified windows and linux behavior.
-rw-r--r--src/lpm.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lpm.lua b/src/lpm.lua
index 992ab9f..28f866b 100644
--- a/src/lpm.lua
+++ b/src/lpm.lua
@@ -391,7 +391,12 @@ function common.rmrf(root)
if not info then return end
if info.type == "file" or info.symlink then
local status, err = os.remove(root)
- if not status then error("can't remove " .. root .. ": " .. err) end
+ if not status then
+ if not err:find("permission") then error("can't remove " .. root .. ": " .. err) end
+ system.chmod(root, 844) -- chmod so that we can write, for windows.
+ status, err = os.remove(root)
+ if not status then error("can't remove " .. root .. ": " .. err) end
+ end
else
for i,v in ipairs(system.ls(root)) do common.rmrf(root .. PATHSEP .. v) end
system.rmdir(root)