util: Fix reporting of git version of klippy code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
c9cd8cea66
commit
167a65d826
|
@ -54,11 +54,11 @@ def get_cpu_info():
|
||||||
|
|
||||||
def get_git_version():
|
def get_git_version():
|
||||||
# Obtain version info from "git" program
|
# Obtain version info from "git" program
|
||||||
gitdir = os.path.join(sys.path[0], '..', '.git')
|
gitdir = os.path.join(sys.path[0], '..')
|
||||||
if not os.path.exists(gitdir):
|
if not os.path.exists(gitdir):
|
||||||
logging.debug("No '.git' file/directory found")
|
logging.debug("No '.git' file/directory found")
|
||||||
return "?"
|
return "?"
|
||||||
prog = "git --git-dir=%s describe --tags --long --dirty" % (gitdir,)
|
prog = "git -C %s describe --tags --long --dirty" % (gitdir,)
|
||||||
try:
|
try:
|
||||||
process = subprocess.Popen(shlex.split(prog), stdout=subprocess.PIPE)
|
process = subprocess.Popen(shlex.split(prog), stdout=subprocess.PIPE)
|
||||||
output = process.communicate()[0]
|
output = process.communicate()[0]
|
||||||
|
|
Loading…
Reference in New Issue