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
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
def repo_branch(): return strip_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'])