Skip to content

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

@compilelife

Description

@compilelife

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

在只能访问内网的访问器上使用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可以更新私有仓库

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions