Skip to content
Snippets Groups Projects
Commit d6a68cc5 authored by anonymous's avatar anonymous
Browse files

change git call for version

parent 7fb8eab8
Branches
Tags
No related merge requests found
...@@ -229,10 +229,15 @@ def odsh_public_resource_url(res): ...@@ -229,10 +229,15 @@ def odsh_public_resource_url(res):
def odsh_get_version_id(): def odsh_get_version_id():
try: try:
# return subprocess.check_output(["git", "rev-parse", "HEAD"]).strip() home = config.get('ckanext.odsh.home', None)
return config.get('ckanext.odsh.version', 'unknown') if home:
if home[-1] == '/':
home = home[:-1]
home += '/.git'
return subprocess.check_output(["git", "--git-dir", home, "rev-parse", "HEAD"]).strip()
except: except:
return 'unknown' return 'unknown'
return 'unknown'
def odsh_show_testbanner(): def odsh_show_testbanner():
return config.get('ckanext.odsh.showtestbanner', 'False') == 'True' return config.get('ckanext.odsh.showtestbanner', 'False') == 'True'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment