def _getdefaultbranch(self): """Gets the default branch from github (usually master)""" #res = None try: res = subprocess.check_output( ". %s/%s" % (absdirname(__file__), "getdefaultbranch.sh"), shell=True) except subprocess.CalledProcessError as ex: if ex.returncode == 10: print( 'ERROR: multiple remotes detected. Repobot only supports repositories with one remote' ) sys.exit(10) else: print('ERROR: an unknown error occured :(') sys.exit(ex.returncode) return str(res, 'utf-8').strip('\n')
def _getcurrentbranch(self): """Gets the branch currently on""" res = subprocess.check_output( ". %s/%s" % (absdirname(__file__), "getcurrentbranch.sh"), shell=True) return str(res, 'utf-8').strip('\n')
def _getcurrentrepo(self) -> str: res = subprocess.check_output( absdirname(__file__) + '/getcurrentrepo.sh') return str(res, 'utf-8').strip('\n')