Skip to content

Commit

Permalink
chg: [update] older versions: filter 5.0 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed May 17, 2023
1 parent 88d3870 commit 5b6a7f1
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions bin/Update.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@

import subprocess

sys.path.append(os.environ['AIL_BIN']) # # TODO: move other functions
sys.path.append(os.environ['AIL_BIN'])
##################################
# Import Project packages
##################################
# TODO: move other functions
from packages import git_status


Expand Down Expand Up @@ -157,7 +161,7 @@ def get_git_current_tag(path_current_version):
with open(path_current_version, 'r') as version_content:
version = version_content.read()
except FileNotFoundError:
version = 'v1.4'
version = 'v5.0' # TODO Replace with VERSION.json
with open(path_current_version, 'w') as version_content:
version_content.write(version)

Expand Down Expand Up @@ -230,9 +234,14 @@ def get_git_upper_tags_remote(current_tag, is_fork):
except ValueError:
continue

# add tag with last commit
if float(tag_val) >= float(current_tag_val):
dict_tags_commit[tag] = commit
if float(current_tag) < 4.2:
# add tag with last commit
if float(current_tag_val) <= float(tag_val) < float(4.2):
dict_tags_commit[tag] = commit
else:
# add tag with last commit
if float(tag_val) >= float(current_tag_val):
dict_tags_commit[tag] = commit
list_upper_tags = [('v{}'.format(key), dict_tags_commit[key]) for key in dict_tags_commit]
# force update order
list_upper_tags.sort()
Expand Down Expand Up @@ -444,3 +453,7 @@ def aborting_update():
print(' {}AIL Auto update is disabled{}'.format(TERMINAL_RED, TERMINAL_DEFAULT))
aborting_update()
sys.exit(0)


# r = get_git_upper_tags_remote('4.2.1', False)
# print(r)

0 comments on commit 5b6a7f1

Please sign in to comment.