summaryrefslogtreecommitdiff
path: root/xmake/modules/private
diff options
context:
space:
mode:
authorruki <[email protected]>2022-10-06 00:56:30 +0800
committerruki <[email protected]>2022-10-06 00:56:30 +0800
commit6013fcd66f60078ed7fec6557fe2a61a3873a0ea (patch)
tree1c9e2ced115ce9a7dbb78464751b9d72b7bef6ff /xmake/modules/private
parent9fcad1a90c2c750e2a2fa8c55962eb0f9495df8b (diff)
remove emptydirs after uninstalling #2901
Diffstat (limited to 'xmake/modules/private')
-rw-r--r--xmake/modules/private/action/clean/remove_files.lua10
1 files changed, 3 insertions, 7 deletions
diff --git a/xmake/modules/private/action/clean/remove_files.lua b/xmake/modules/private/action/clean/remove_files.lua
index 3a679adcb..19a2dd01b 100644
--- a/xmake/modules/private/action/clean/remove_files.lua
+++ b/xmake/modules/private/action/clean/remove_files.lua
@@ -22,15 +22,11 @@
import("core.base.option")
-- remove the given files or (empty) directories
-function main(filedirs)
-
+function main(filedirs, opt)
+ opt or {}
for _, filedir in ipairs(filedirs) do
-
- -- remove it first
os.tryrm(filedir)
-
- -- remove all?
- if option.get("all") then
+ if option.get("all") or opt.emptydir then
-- remove it if the parent directory is empty
local parentdir = path.directory(filedir)
while parentdir and os.isdir(parentdir) and os.emptydir(parentdir) do