api: LXR_PROJ_DIR is authoritative (#129)

Always set LXR_DATA_DIR and LXR_REPO_DIR based on LXR_PROJ_DIR.
Fixes #129.

Also, verbose output from Travis tests.
This commit is contained in:
Chris White 2020-05-23 15:35:09 -04:00
parent 52d52cb2d6
commit 1153a0b263
2 changed files with 9 additions and 5 deletions

View file

@ -16,4 +16,4 @@ before_install:
- sudo dpkg -i universal-ctags_0+git20221222-0ubuntu1_amd64.deb
script:
- prove
- prove -v

View file

@ -5,13 +5,17 @@ import os
import falcon
ELIXIR_DIR = os.path.dirname(__file__) + '/..'
ELIXIR_DIR = os.path.dirname(os.path.realpath(__file__)) + '/..'
def build_query(env, project):
if 'LXR_DATA_DIR' not in os.environ or 'LXR_REPO_DIR' not in os.environ:
try:
basedir = env['LXR_PROJ_DIR']
os.environ['LXR_DATA_DIR']= basedir + '/' + project + '/data'
os.environ['LXR_REPO_DIR'] = basedir + '/' + project + '/repo'
except KeyError:
basedir = os.environ['LXR_PROJ_DIR']
# fail if it's not defined either place
os.environ['LXR_DATA_DIR']= basedir + '/' + project + '/data'
os.environ['LXR_REPO_DIR'] = basedir + '/' + project + '/repo'
import sys
sys.path = [ ELIXIR_DIR ] + sys.path