diff options
| author | ruki <[email protected]> | 2020-12-15 22:49:21 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-12-15 22:49:21 +0800 |
| commit | 4f68442093fc8db5ae13a7f516198058d962fd35 (patch) | |
| tree | b30832794f50a093e594a5d3722ba0bfb2f101de | |
| parent | 69613eacabc6c50e0a4ca34b1907d74ec03861b9 (diff) | |
fix require/install
| -rw-r--r-- | xmake/actions/require/install.lua | 9 |
1 files 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 |
