mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-23 06:37:15 +00:00
fix: [update] fix is_fork check
This commit is contained in:
parent
35c188829f
commit
99b9c95638
1 changed files with 10 additions and 19 deletions
|
@ -39,16 +39,11 @@ def check_if_files_modified():
|
||||||
|
|
||||||
def repo_is_fork():
|
def repo_is_fork():
|
||||||
print('Check if this repository is a fork:')
|
print('Check if this repository is a fork:')
|
||||||
process = subprocess.run(['git', 'ls-remote', '--tags'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
process = subprocess.run(['git', 'remote', '-v'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
|
|
||||||
if process.returncode == 0:
|
if process.returncode == 0:
|
||||||
# remove url origin
|
res = process.stdout.decode()
|
||||||
local_remote = process.stdout
|
if 'origin {}'.format(AIL_REPO) in res:
|
||||||
process = subprocess.run(['git', 'ls-remote' ,'--tags', AIL_REPO], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
||||||
|
|
||||||
if process.returncode == 0:
|
|
||||||
ail_remote = process.stdout
|
|
||||||
if local_remote == ail_remote:
|
|
||||||
print(' This repository is a {}clone of {}{}'.format(TERMINAL_BLUE, AIL_REPO, TERMINAL_DEFAULT))
|
print(' This repository is a {}clone of {}{}'.format(TERMINAL_BLUE, AIL_REPO, TERMINAL_DEFAULT))
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
|
@ -59,10 +54,6 @@ def repo_is_fork():
|
||||||
print('{}{}{}'.format(TERMINAL_RED, process.stderr.decode(), TERMINAL_DEFAULT))
|
print('{}{}{}'.format(TERMINAL_RED, process.stderr.decode(), TERMINAL_DEFAULT))
|
||||||
aborting_update()
|
aborting_update()
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
else:
|
|
||||||
print('{}{}{}'.format(TERMINAL_RED, process.stderr.decode(), TERMINAL_DEFAULT))
|
|
||||||
aborting_update()
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
def is_upstream_created(upstream):
|
def is_upstream_created(upstream):
|
||||||
process = subprocess.run(['git', 'remote', '-v'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
process = subprocess.run(['git', 'remote', '-v'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
|
@ -195,8 +186,8 @@ def get_git_upper_tags_remote(current_tag, is_fork):
|
||||||
|
|
||||||
def update_ail(current_tag, list_upper_tags_remote, current_version_path, is_fork):
|
def update_ail(current_tag, list_upper_tags_remote, current_version_path, is_fork):
|
||||||
print('{}git checkout master:{}'.format(TERMINAL_YELLOW, TERMINAL_DEFAULT))
|
print('{}git checkout master:{}'.format(TERMINAL_YELLOW, TERMINAL_DEFAULT))
|
||||||
#process = subprocess.run(['git', 'checkout', 'master'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
process = subprocess.run(['git', 'checkout', 'master'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
process = subprocess.run(['ls'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
#process = subprocess.run(['ls'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
if process.returncode == 0:
|
if process.returncode == 0:
|
||||||
print(process.stdout.decode())
|
print(process.stdout.decode())
|
||||||
print()
|
print()
|
||||||
|
|
Loading…
Reference in a new issue