From f4afb2b878bc58c54e2acf8dfd1130e482f014a4 Mon Sep 17 00:00:00 2001 From: Jeremiah Leary Date: Wed, 10 Feb 2021 19:18:43 -0600 Subject: [PATCH] Updates for issue #486: Fixing issue with zip file installations under a git repo were reporting the git repo sha number. --- vsg/version.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vsg/version.py b/vsg/version.py index 5376165b..2a7ddfd5 100644 --- a/vsg/version.py +++ b/vsg/version.py @@ -32,9 +32,12 @@ def get_version_info(sVersion, sShaNum): if sVersion is not None and sShaNum is not None: return sVersion, sShaNum + sReturnPath = os.getcwd() + sPath = os.path.dirname(__file__) + if not os.path.isdir(os.path.join(sPath, '..', '.git')): + return sVersion + '+zip.file', 'Unknown. Installed via zip file.' + try: - sReturnPath = os.getcwd() - sPath = os.path.dirname(__file__) os.chdir(sPath) lActual = subprocess.check_output(['git', 'describe', '--tags']) lActual = str(lActual.decode('utf-8')).split('\n')