Fix template folder for Debian based distros

Debian based distros install files in /usr/local not in
sys.prefix. See [1] for more info.

[1] https://wiki.debian.org/Python#Deviations_from_upstream

Change-Id: I8bd9098f3f529a5ded2b6d2ec8b5081c34590ea8
This commit is contained in:
rossella 2016-04-18 22:21:29 +00:00
parent 14f7705d0c
commit 966789d2aa
1 changed files with 2 additions and 0 deletions

View File

@ -83,6 +83,8 @@ def get_options():
# We need to support running with and without installation
if os.path.exists('templates'):
template_dir = 'templates'
elif os.path.exists('/usr/local/share/gerrit-dash-creator/templates'):
template_dir = '/usr/local/share/gerrit-dash-creator/templates'
else:
template_dir = os.path.join(sys.prefix, 'share',
'gerrit-dash-creator', 'templates')