Fixed git tag checking on repos with lots of tags; removed some extra debug lines

This commit is contained in:
Gregory Ballantine 2021-04-04 11:35:12 -04:00
parent 556e7e5e23
commit 7d76d9c1b9
2 changed files with 4 additions and 5 deletions

View File

@ -65,19 +65,17 @@ class FormulaRepo():
def check_tracking_info(self, version): def check_tracking_info(self, version):
# tracking a specific tag on the repo # tracking a specific tag on the repo
# check to make sure that the given tag name actually exists first # check to make sure that the given tag name actually exists first
if not version in self.get_tags(): if not version in self.repo.tag('-l', version):
print('%s is not an existing tag name for %s - please fix this.' % (version, self.repo_path)) print('%s is not an existing tag name for %s - please fix this.' % (version, self.repo_path))
sys.exit(1) sys.exit(1)
repo_tag = self.get_current_version() repo_tag = self.get_current_version()
print(version)
print(repo_tag)
# check to make sure that the current tracked tag is, in fact, what we want # check to make sure that the current tracked tag is, in fact, what we want
if version != repo_tag: if version != repo_tag:
self.switch_version(version) self.switch_version(version)
# let the user know which tag we're using # let the user know which tag we're using
print('For %s, we\'re using the \'%s\' tag.' % (self.repo_path, version)) #print('For %s, we\'re using the \'%s\' tag.' % (self.repo_path, version))
# pull any new updates for the repo # pull any new updates for the repo

View File

@ -12,6 +12,7 @@ class Utils():
@staticmethod @staticmethod
def remove_ansi_from_list(l): def remove_ansi_from_list(l):
for index, element in enumerate(l): for index, element in enumerate(l):
l[index] = Utils.remove_ansi(element) l[index] = Utils.remove_ansi(element).strip()
return l return l