summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-11-30 00:42:58 +0800
committerruki <[email protected]>2024-11-30 00:42:58 +0800
commitd5cfb02a82a02455e0af1d9f9e5d3f49cb991b4e (patch)
tree98951626ec4da2d20dde988265647bbc396c9cdf
parentfc0b268bd8bc991f7e04ccaa4179709abafb0b78 (diff)
clean empty dirs
-rw-r--r--xmake/modules/private/action/require/impl/package.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua
index 90e34fcef..8e11b7c73 100644
--- a/xmake/modules/private/action/require/impl/package.lua
+++ b/xmake/modules/private/action/require/impl/package.lua
@@ -1652,6 +1652,12 @@ function load_packages(requires, opt)
-- we need to reload packages with new resolved deps if there are some dep conflicts
if not table.empty(resolvedinfo) then
+ for _, package in ipairs(packages) do
+ local installdir = package:installdir({readonly = true})
+ if os.isdir(installdir) and os.emptydir(installdir) then
+ os.tryrm(installdir, {emptydirs = true})
+ end
+ end
unique = {}
packages = {}
_memcache():clear()