summaryrefslogtreecommitdiff
path: root/xmake/modules/private/action/require/impl/environment.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/modules/private/action/require/impl/environment.lua')
-rw-r--r--xmake/modules/private/action/require/impl/environment.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/xmake/modules/private/action/require/impl/environment.lua b/xmake/modules/private/action/require/impl/environment.lua
index ae6950de3..115f263aa 100644
--- a/xmake/modules/private/action/require/impl/environment.lua
+++ b/xmake/modules/private/action/require/impl/environment.lua
@@ -54,6 +54,7 @@ function enter()
end
-- enter the environments of installed packages
+ _g._OLDENVS = os.getenvs()
for _, instance in ipairs(packages) do
instance:envs_enter()
end
@@ -64,9 +65,8 @@ end
function leave()
-- leave the environments of installed packages
- for _, instance in irpairs(_g._PACKAGES) do
- instance:envs_leave()
- end
+ os.setenvs(_g._OLDENVS)
+ _g._OLDENVS = nil
_g._PACKAGES = nil
-- leave the environments of git