improved logging of the commit hash

xkb
sezanzeb 3 years ago committed by sezanzeb
parent bbe4217aad
commit 4c78955c67

@ -34,7 +34,7 @@ start = time.time()
previous_key_spam = None
COMMIT_HASH = ''
COMMIT_HASH = '' # overwritten in setup.py
def spam(self, message, *args, **kwargs):

@ -29,7 +29,7 @@ from setuptools.command.install import install
class Install(install):
"""Add the current commit hash to logger.py."""
def run(self):
commit = os.popen('git rev-parse HEAD').read().replace('\n', '')
commit = os.popen('git rev-parse HEAD').read().strip()
if re.match(r'^([a-z]|[0-9])+$', commit):
with open('keymapper/logger.py', 'r') as f:
contents = f.read()

Loading…
Cancel
Save