diff options
| author | ruki <[email protected]> | 2020-09-13 11:19:00 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-09-13 11:19:00 +0800 |
| commit | ef70952ae3e4425c670673954b62be65437f1e58 (patch) | |
| tree | 3399e04276ab543aa31bee446cc9a8265948e8eb | |
| parent | bb0b06f897f920f28309417a32f9bcb07987d0d9 (diff) | |
add private network
| -rw-r--r-- | xmake/actions/global/xmake.lua | 6 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/import/core/package/repository.lua | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/xmake/actions/global/xmake.lua b/xmake/actions/global/xmake.lua index ae8e752c2..56c6e4716 100644 --- a/xmake/actions/global/xmake.lua +++ b/xmake/actions/global/xmake.lua @@ -50,8 +50,10 @@ task("global") end} , {nil, "debugger", "kv", "auto" , "The debugger program path." } - -- proxy configuration - , {category = "Proxy Configuration"} + -- network configuration + , {category = "Network Configuration"} + , {nil, "network", "kv", "public" , "Set the network mode." + , values = {"public", "private"} } , {'x', "proxy", "kv", nil , "Use proxy on given port. [protocol://]host[:port]" , " e.g." , " - xmake g --proxy='http://host:port'" diff --git a/xmake/core/sandbox/modules/import/core/package/repository.lua b/xmake/core/sandbox/modules/import/core/package/repository.lua index ff398ff1b..8c5be515e 100644 --- a/xmake/core/sandbox/modules/import/core/package/repository.lua +++ b/xmake/core/sandbox/modules/import/core/package/repository.lua @@ -22,6 +22,7 @@ local sandbox_core_package_repository = sandbox_core_package_repository or {} -- load modules +local global = require("base/global") local project = require("project/project") local repository = require("package/repository") local raise = require("sandbox/modules/raise") @@ -72,7 +73,7 @@ function sandbox_core_package_repository.repositories(is_global) -- add main global xmake repository local repositories = {} - if is_global then + if is_global and global.get("network") ~= "private" then -- import fasturl import("net.fasturl") |
