Beispiel #1
0
def repo_path():
    url = strip_output(['git', 'config', '--get', 'remote.origin.url'])
    if not url:
        raise Exception('No git remote')
    path = url.split(':')[-1]
    no_git = re.sub('\.git$', '', path)
    return no_git
Beispiel #2
0
def github_token():
    try:
        return strip_output([TOKEN_BIN])
    except OSError as e:
        if e.errno == 2:
            raise Exception("{} command not found".format(TOKEN_BIN))
        raise
Beispiel #3
0
def repo_branch():
    return strip_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'])