diff options
Diffstat (limited to 'xmake/modules/devel/git')
| -rw-r--r-- | xmake/modules/devel/git/clone.lua | 10 | ||||
| -rw-r--r-- | xmake/modules/devel/git/ls_remote.lua | 10 | ||||
| -rw-r--r-- | xmake/modules/devel/git/pull.lua | 10 |
3 files changed, 27 insertions, 3 deletions
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 diff --git a/xmake/modules/devel/git/ls_remote.lua b/xmake/modules/devel/git/ls_remote.lua index a52e0d68d..ebbb99d98 100644 --- a/xmake/modules/devel/git/ls_remote.lua +++ b/xmake/modules/devel/git/ls_remote.lua @@ -20,6 +20,7 @@ -- imports import("core.base.option") +import("core.base.global") import("lib.detect.find_tool") -- ls_remote to given branch, tag or commit @@ -55,8 +56,15 @@ function main(reftype, url) print("%s %s", git.program, os.args(argv)) end + -- use proxy? + local envs + local proxy = global.get("proxy") + if proxy then + envs = {ALL_PROXY = proxy} + end + -- get refs - local data = os.iorunv(git.program, argv) + local data = os.iorunv(git.program, argv, {envs = envs}) -- get commmits and tags local refs = {} diff --git a/xmake/modules/devel/git/pull.lua b/xmake/modules/devel/git/pull.lua index 7eba74114..6e0f0a735 100644 --- a/xmake/modules/devel/git/pull.lua +++ b/xmake/modules/devel/git/pull.lua @@ -20,6 +20,7 @@ -- imports import("core.base.option") +import("core.base.global") import("lib.detect.find_tool") -- pull remote commits @@ -63,8 +64,15 @@ function main(opt) oldir = os.cd(opt.repodir) end + -- use proxy? + local envs + local proxy = global.get("proxy") + if proxy then + envs = {ALL_PROXY = proxy} + end + -- pull it - os.vrunv(git.program, argv) + os.vrunv(git.program, argv, {envs = envs}) -- leave repository directory if oldir then |
