From b9cd00cacfff6a291904afb00bc7285364cc8560 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 14 Sep 2018 00:50:51 +0800 Subject: add package path --- xmake/actions/require/package.lua | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- cgit v1.3.1