summaryrefslogtreecommitdiff
path: root/xmake/actions/clean/main.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/actions/clean/main.lua')
-rw-r--r--xmake/actions/clean/main.lua10
1 files changed, 2 insertions, 8 deletions
diff --git a/xmake/actions/clean/main.lua b/xmake/actions/clean/main.lua
index 4dc42437a..e9e574545 100644
--- a/xmake/actions/clean/main.lua
+++ b/xmake/actions/clean/main.lua
@@ -56,11 +56,7 @@ function _clean_target(target)
end
-- enter the environments of the target packages
- local oldenvs = {}
- for name, values in pairs(target:pkgenvs()) do
- oldenvs[name] = os.getenv(name)
- os.addenv(name, unpack(values))
- end
+ local oldenvs = os.addenvs(target:pkgenvs())
-- the target scripts
local scripts =
@@ -95,9 +91,7 @@ function _clean_target(target)
end
-- leave the environments of the target packages
- for name, values in pairs(oldenvs) do
- os.setenv(name, values)
- end
+ os.setenvs(oldenvs)
end
-- clean the given targets