From 873b532f381d4dddabe5370dcffef49816f9f808 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 23 Jun 2020 22:52:21 +0800 Subject: add global proxy settings --- xmake/modules/devel/git/clone.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'xmake/modules/devel/git/clone.lua') diff --git a/xmake/modules/devel/git/clone.lua b/xmake/modules/devel/git/clone.lua index 4285b392d..a2fb554fb 100644 --- a/xmake/modules/devel/git/clone.lua +++ b/xmake/modules/devel/git/clone.lua @@ -20,6 +20,7 @@ -- imports import("core.base.option") +import("core.base.global") import("lib.detect.find_tool") -- clone url @@ -75,6 +76,13 @@ function main(url, opt) table.insert(argv, path.translate(opt.outputdir)) end + -- use proxy? + local envs + local proxy = global.get("proxy") + if proxy then + envs = {ALL_PROXY = proxy} + end + -- clone it - os.vrunv(git.program, argv) + os.vrunv(git.program, argv, {envs = envs}) end -- cgit v1.3.1