Ejemplo n.º 1
0
def _get_code_dir_url(repo, config):
    repos = list_repos(config)
    if repo not in repos:
        raise RepoNotFoundException
    data = config['repos'][repo]
    url = data['url']
    code_dir = _get_code_dir_from_url(url)
    return code_dir, url
Ejemplo n.º 2
0
def _get_code_dir_url(repo, config):
    repos = list_repos(config)
    if repo not in repos:
        raise RepoNotFoundException
    data = config['repos'][repo]
    url = data['url']
    code_dir = _get_code_dir_from_url(url)
    return code_dir, url
Ejemplo n.º 3
0
def _install_repo(repo, config=None, git_command=None):
    repos = list_repos(config)
    config = get_config(config)
    if repo not in repos:
        raise RepoNotFoundException

    data = config['repos'][repo]

    if not git_command:
        git_command = __git_command


    url = data['url']
    code_dir = get_code_dir(url)
    if os.path.exists(code_dir):
        raise RepoAlreadyInstalledException(
            "Something already exists in {}.  "
            "What more do you want?".format(code_dir))

    if not os.path.exists(_get_code_base_dir()):
        raise WheeljackCodeDirectoryMissing
    return git_command(url)
Ejemplo n.º 4
0
 def test_list_repos(self):
     expected = ['nuggets', 'wheeljack']
     config = yaml.load(DUMMY_CONFIG)
     eq_(expected, list_repos(config))
Ejemplo n.º 5
0
 def test_list_repos(self):
     expected = ['nuggets', 'wheeljack']
     config = yaml.load(DUMMY_CONFIG)
     eq_(expected, list_repos(config))