Beispiel #1
0
def set_git_repo(repo: 'Repo') -> str:
    from libs.repos.git import ensure_repo_paths, get_git_repo

    # Ensure paths
    ensure_repo_paths(repo=repo)

    # Create a new repo
    get_git_repo(repo_path=repo.path, init=True)
    return repo.path
Beispiel #2
0
def set_git_repo(repo: 'Repo') -> None:
    from libs.repos.git import get_git_repo

    # Check that the user has a dir
    if not os.path.isdir(repo.user_path):
        create_path(repo.user_path)

    # Check that the project has a dir
    if not os.path.isdir(repo.project_path):
        create_path(repo.project_path)

    # Create a new repo
    get_git_repo(repo_path=repo.path, init=True)
Beispiel #3
0
def set_git_repo(git_url: str) -> None:
    from libs.repos.git import get_git_repo

    mount_path = conf.get('REPOS_MOUNT_PATH')
    repo_name = get_repo_name(git_url=git_url)
    repo_owner = repo_name.split('/')[0]

    # Check that the owner has a dir
    owner_path = '{}/{}'.format(mount_path, repo_owner)
    if not os.path.isdir(owner_path):
        create_path(owner_path)

    # Check that the project has a dir
    repo_path = '{}/{}'.format(mount_path, repo_name)
    if not os.path.isdir(repo_path):
        create_path(repo_path)

    # Create a new repo
    get_git_repo(repo_path=repo_path, init=True)
Beispiel #4
0
    def git(self) -> Any:
        from libs.repos import git

        return git.get_git_repo(repo_path=self.path)
Beispiel #5
0
    def git(self):
        from libs.repos import git

        return git.get_git_repo(repo_path=self.path)