From ed1f65616703ccaee1d44d6b180993a14806bf70 Mon Sep 17 00:00:00 2001 From: smilerz Date: Mon, 4 Dec 2023 11:59:22 -0600 Subject: [PATCH] fix version information on system page --- cookbook/version_info.py | 4 ++-- version.py | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cookbook/version_info.py b/cookbook/version_info.py index 65c43581..b3617f8a 100644 --- a/cookbook/version_info.py +++ b/cookbook/version_info.py @@ -1,3 +1,3 @@ TANDOOR_VERSION = "" -TANDOOR_REF = "" -VERSION_INFO = [] +TANDOOR_REF = "abf8f791360b2bc4a5c7d011877668679bcbb3f2" +VERSION_INFO = [{'name': 'Tandoor ', 'version': "commit abf8f791360b2bc4a5c7d011877668679bcbb3f2\nMerge: 4723a7ec fd028047\nAuthor: vabene1111 \nDate: Sun Dec 3 14:10:28 2023 +0100\n\n Merge branch 'develop'\n \n # Conflicts:\n # docs/faq.md\n", 'website': 'https://github.com/TandoorRecipes/recipes', 'commit_link': 'https://github.com/TandoorRecipes/recipes/commit/abf8f791360b2bc4a5c7d011877668679bcbb3f2', 'ref': 'abf8f791360b2bc4a5c7d011877668679bcbb3f2', 'branch': 'HEAD', 'tag': ''}] \ No newline at end of file diff --git a/version.py b/version.py index ae46b42e..037e84d2 100644 --- a/version.py +++ b/version.py @@ -13,12 +13,11 @@ tandoor_hash = '' try: print('getting tandoor version') r = subprocess.check_output(['git', 'show', '-s'], cwd=BASE_DIR).decode() - tandoor_branch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'], cwd=BASE_DIR).decode() + tandoor_branch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'], cwd=BASE_DIR).decode().replace('\n', '') tandoor_hash = r.split('\n')[0].split(' ')[1] try: - tandoor_tag = subprocess.check_output(['git', 'describe', '--exact-match', tandoor_hash], cwd=BASE_DIR).decode().replace('\n', '') - except: - + tandoor_tag = subprocess.check_output(['git', 'describe', '--exact-match', '--tags', tandoor_hash], cwd=BASE_DIR).decode().replace('\n', '') + except BaseException: pass version_info.append({ @@ -47,8 +46,9 @@ try: commit_hash = r.split('\n')[0].split(' ')[1] try: print('running describe') - tag = subprocess.check_output(['git', 'describe', '--exact-match', commit_hash], cwd=os.path.join(BASE_DIR, 'recipes', 'plugins', d)).decode().replace('\n', '') - except: + tag = subprocess.check_output(['git', 'describe', '--exact-match', commit_hash], + cwd=os.path.join(BASE_DIR, 'recipes', 'plugins', d)).decode().replace('\n', '') + except BaseException: tag = '' version_info.append({ @@ -66,7 +66,7 @@ try: traceback.print_exc() except subprocess.CalledProcessError as e: print("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output)) -except: +except BaseException: traceback.print_exc() with open('cookbook/version_info.py', 'w+', encoding='UTF-8') as f: