Skip to content
Snippets Groups Projects
Commit 9fa01c95 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Closes 146

The attempt to capture git version information is not much more robust.
If any error is raised, the error is printed, but won't break the
install. This means if, for example, git it not installed then it will
still work.
parent e0044114
No related branches found
No related tags found
1 merge request!117Clean up of setup
Pipeline #
......@@ -26,16 +26,18 @@ def write_version_file(version):
+ subprocess.check_output(
['git', 'diff', '--cached', '.'])).decode('utf-8')
if git_diff == '':
status = '(CLEAN) ' + git_log
git_status = '(CLEAN) ' + git_log
else:
status = '(UNCLEAN) ' + git_log
except subprocess.CalledProcessError:
status = ''
git_status = '(UNCLEAN) ' + git_log
except Exception as e:
print("Unable to obtain git version information, exception: {}"
.format(e))
git_status = ''
version_file = '.version'
if path.isfile(version_file) is False:
with open('tupak/' + version_file, 'w+') as f:
f.write('{} - {}'.format(version, status))
f.write('{}: {}'.format(version, git_status))
return version_file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment