diff options
| author | Ângelo Andrade Cirino <[email protected]> | 2022-01-17 10:56:56 -0300 |
|---|---|---|
| committer | Ângelo Andrade Cirino <[email protected]> | 2022-01-17 10:56:56 -0300 |
| commit | 92978c6f56ab66e17e19776d2e35832fa8be6e97 (patch) | |
| tree | 8156c9043b20682df56ee30f673ac84a2c042eeb /xmake/scripts/pac/github_mirror.lua | |
| parent | 274244bf3530a77ab3c93309e5ea5bb5d29907ae (diff) | |
| parent | b86e3b25723812bdf0c20bc1d3d4075d47b57523 (diff) | |
Merge branch 'master' of https://github.com/xmake-io/xmake into modnamefix
Diffstat (limited to 'xmake/scripts/pac/github_mirror.lua')
| -rw-r--r-- | xmake/scripts/pac/github_mirror.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/xmake/scripts/pac/github_mirror.lua b/xmake/scripts/pac/github_mirror.lua new file mode 100644 index 000000000..026a9a50c --- /dev/null +++ b/xmake/scripts/pac/github_mirror.lua @@ -0,0 +1,12 @@ +import("net.fasturl") + +function mirror(url) + local configs = {} + local proxyurls = {"github.com.cnpmjs.org", "hub.fastgit.org"} + fasturl.add(proxyurls) + proxyurls = fasturl.sort(proxyurls) + if #proxyurls > 0 then + return url:replace("/github.com/", "/" .. proxyurls[1] .. "/", {plain = true}) + end +end + |
