summaryrefslogtreecommitdiff
path: root/xmake/modules/devel/git/clone.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/modules/devel/git/clone.lua')
-rw-r--r--xmake/modules/devel/git/clone.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/xmake/modules/devel/git/clone.lua b/xmake/modules/devel/git/clone.lua
index 4285b392d..ef3aa769b 100644
--- a/xmake/modules/devel/git/clone.lua
+++ b/xmake/modules/devel/git/clone.lua
@@ -21,6 +21,7 @@
-- imports
import("core.base.option")
import("lib.detect.find_tool")
+import("net.proxy")
-- clone url
--
@@ -75,6 +76,13 @@ function main(url, opt)
table.insert(argv, path.translate(opt.outputdir))
end
+ -- use proxy?
+ local envs
+ local proxy_conf = proxy.get(url)
+ if proxy_conf then
+ envs = {ALL_PROXY = proxy_conf}
+ end
+
-- clone it
- os.vrunv(git.program, argv)
+ os.vrunv(git.program, argv, {envs = envs})
end