scanner.py 文件源码

python
阅读 43 收藏 0 点赞 0 评论 0

项目:dupin 作者: guardian 项目源码 文件源码
def _checkout_if_not_present(repo_url, repos_root):
    """Returns the existing repository if it exists,
    otherwises puts a fresh clone in the right place
    """
    repo_name = os.path.basename(urlparse(repo_url).path)
    local_repo_path = os.path.join(repos_root, repo_name)

    if os.path.isdir(local_repo_path):
        return Repo(local_repo_path)
    else:
        printerr("Cloning new repo {repo} into {location}".format(repo=repo_name, location=local_repo_path))
        return Repo.clone_from(repo_url, local_repo_path)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号