From 4f68442093fc8db5ae13a7f516198058d962fd35 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 15 Dec 2020 22:49:21 +0800 Subject: fix require/install --- xmake/actions/require/install.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xmake/actions/require/install.lua b/xmake/actions/require/install.lua index 0367132a8..ea9f3dfe5 100644 --- a/xmake/actions/require/install.lua +++ b/xmake/actions/require/install.lua @@ -176,18 +176,21 @@ function main(requires_raw) return end - -- enter environment + -- find git environment.enter() + local git = find_tool("git") + environment.leave() -- pull all repositories first if not exists -- -- attempt to install git from the builtin-packages first if git not found -- - if find_tool("git") and not repository.pulled() then + if git and not repository.pulled() then task.run("repo", {update = true}) end -- install packages + environment.enter() local packages = package.install_packages(requires, {requires_extra = requires_extra}) if packages then @@ -197,8 +200,6 @@ function main(requires_raw) -- register all required local packages _register_required_packages(packages) end - - -- leave environment environment.leave() end -- cgit v1.3.1