Exemple #1
0
def update_local(repo_url, owner):
    """从本地仓库读取文章,更新数据库内容"""
    dest = os.path.join(current_app.config["ARTICLE_DEST"], owner)
    if not os.path.exists(dest):
        os.makedirs(dest)
    return gitutil.pull_or_clone(repo_url, dest)
Exemple #2
0
def test_pull_or_clone():
    err, ret = gitutil.pull_or_clone(REPO_URL, REPO_EN)
    assert not err
    err, ret = gitutil.pull_or_clone(REPO_URL, REPO_CN)
    assert not err