diff options
Diffstat (limited to 'xmake/actions/package/main.lua')
| -rw-r--r-- | xmake/actions/package/main.lua | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/xmake/actions/package/main.lua b/xmake/actions/package/main.lua index 39078392b..a1fcab5ed 100644 --- a/xmake/actions/package/main.lua +++ b/xmake/actions/package/main.lua @@ -147,11 +147,7 @@ function _package_target(target) local oldir = os.cd(project.directory()) -- 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 = @@ -186,9 +182,7 @@ function _package_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) -- leave project directory os.cd(oldir) |
