diff options
| author | ruki <[email protected]> | 2025-12-03 00:36:40 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-12-03 00:36:40 +0800 |
| commit | 410c9ad1bef7982b47852491a3a9a7d870c090b5 (patch) | |
| tree | e581291a60219f1e23cccae94c3a38089b3e207e /xmake/modules/devel/git/submodule/update.lua | |
| parent | f9b12064a91aa52c55bbdac82d6ae2788fdf0d14 (diff) | |
fix proxy in git
Diffstat (limited to 'xmake/modules/devel/git/submodule/update.lua')
| -rw-r--r-- | xmake/modules/devel/git/submodule/update.lua | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/xmake/modules/devel/git/submodule/update.lua b/xmake/modules/devel/git/submodule/update.lua index 5660d5506..da2c02cc0 100644 --- a/xmake/modules/devel/git/submodule/update.lua +++ b/xmake/modules/devel/git/submodule/update.lua @@ -20,7 +20,9 @@ -- imports import("core.base.option") +import("devel.git.remote") import("lib.detect.find_tool") +import("net.proxy") -- update submodule -- @@ -70,6 +72,18 @@ function main(opt) table.join2(argv, opt.paths) end + -- use proxy? + local envs + local proxy_conf = proxy.config() + if proxy_conf then + -- get proxy configuration from the current remote url + local url = remote.get_url({remote = opt.remote or "origin", repodir = opt.repodir}) + if url then + proxy_conf = proxy.config(url) + end + envs = {ALL_PROXY = proxy_conf} + end + -- update it - os.vrunv(git.program, argv, {curdir = opt.repodir}) + os.vrunv(git.program, argv, {envs = envs, curdir = opt.repodir}) end |
