mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-26 15:57:16 +00:00
chg: [Updater] change default branch origin
This commit is contained in:
parent
bec7c52485
commit
b6dc8e92b2
1 changed files with 15 additions and 1 deletions
|
@ -9,6 +9,20 @@ TERMINAL_BLUE = '\33[94m'
|
|||
TERMINAL_BLINK = '\33[6m'
|
||||
TERMINAL_DEFAULT = '\033[0m'
|
||||
|
||||
# set defaut_remote
|
||||
def set_default_remote(new_origin_url, verbose=False):
|
||||
process = subprocess.run(['git', 'remote', 'set-url', 'origin', new_origin_url], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
if process.returncode == 0:
|
||||
res = process.stdout
|
||||
if res == b'':
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
else:
|
||||
if verbose:
|
||||
print('{}{}{}'.format(TERMINAL_RED, process.stderr.decode(), TERMINAL_DEFAULT))
|
||||
return False
|
||||
|
||||
# Check if working directory is clean
|
||||
def is_working_directory_clean(verbose=False):
|
||||
if verbose:
|
||||
|
@ -135,6 +149,6 @@ if __name__ == "__main__":
|
|||
get_last_commit_id_from_local(verbose=True)
|
||||
get_last_tag_from_local(verbose=True)
|
||||
get_current_branch(verbose=True)
|
||||
print(is_fork('https://github.com/CIRCL/AIL-framework.git'))
|
||||
print(is_fork('https://github.com/ail-project/ail-framework.git'))
|
||||
print(is_working_directory_clean())
|
||||
get_last_tag_from_remote(verbose=True)
|
||||
|
|
Loading…
Reference in a new issue