Corrected detection of git revision
import kge
import os
+from path import Path
import inspect
import subprocess
@@ -15,11 +16,13 @@ def is_number(s, number_type):
# from https://stackoverflow.com/questions/14989858/get-the-current-git-hash-in-a-python-script
def get_git_revision_hash():
+ with Path(kge_base_dir()):
return subprocess.check_output(["git", "rev-parse", "HEAD"]).strip().decode()
# from https://stackoverflow.com/questions/14989858/get-the-current-git-hash-in-a-python-script
def get_git_revision_short_hash():
+ with Path(kge_base_dir()):
return (
subprocess.check_output(["git", "rev-parse", "--short", "HEAD"])
.strip()
