Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xmake repo -u 支持仅更新私有仓库 #947

Closed
compilelife opened this issue Sep 13, 2020 · 2 comments
Closed

xmake repo -u 支持仅更新私有仓库 #947

compilelife opened this issue Sep 13, 2020 · 2 comments

Comments

@compilelife
Copy link
Contributor

你在什么场景下需要该功能?

在只能访问内网的访问器上使用xmake,repo更新时会尝试访问github/gitee,然后超时失败,导致无法构建

描述可能的解决方案

repo/main.lua里原来的逻辑

function _update()
    repos = table.join(repository.repositories(false), repository.repositories(true))

是否可以增加一个选项控制“是否更新远程仓库”

function _update(is_global)
        local repos
        if is_global then
            repos = table.join(repository.repositories(false), repository.repositories(true))
        else
            repos = repository.repositories(false)
        end

可以复用global选项。

这样,xmake repo -u -g可以更新私有和远程仓库;xmake repo -u可以更新私有仓库

当然,这改变了默认的行为,可能还是新增一个选项来的好用。

@waruqi
Copy link
Member

waruqi commented Sep 13, 2020

我加了个全局配置,开启私有网络模式,所有的操作都会避免对外网的访问。

xmake g --network=private

@compilelife
Copy link
Contributor Author

测试有效

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants