diff options
| author | ruki <[email protected]> | 2018-09-14 00:50:51 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-09-13 23:05:06 +0800 |
| commit | b9cd00cacfff6a291904afb00bc7285364cc8560 (patch) | |
| tree | a93e2b741da35f2a03f3df42cdf6eefb6648ec6c | |
| parent | d07c0752aea017f1d0f26b1c95d4e4971dfce486 (diff) | |
add package path
| -rw-r--r-- | xmake/actions/require/package.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/xmake/actions/require/package.lua b/xmake/actions/require/package.lua index 752c85622..301f960ef 100644 --- a/xmake/actions/require/package.lua +++ b/xmake/actions/require/package.lua @@ -493,11 +493,20 @@ function install_packages(requires, requires_extra) end) -- install all required packages from repositories + local pathes = os.getenv("PATH") for _, package in ipairs(packages) do + + -- enter package environment + if package:kind() == "binary" then + os.addenv("PATH", package:installdir("bin")) + end + + -- install package if (option.get("force") or not package:exists()) and (#package:urls() > 0 or package:script("install")) then action.install(package) end end + os.setenv("PATH", pathes) -- ok return packages |
