elixir/lib: shorten getDataDir() & getRepoDir()

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
This commit is contained in:
Théo Lebrun 2025-02-03 11:51:32 +01:00
parent 0d2f11baba
commit 29cf6a5f48

View file

@ -196,19 +196,17 @@ def autoBytes(arg):
def getDataDir():
try:
dir=os.environ['LXR_DATA_DIR']
return os.environ['LXR_DATA_DIR']
except KeyError:
print(sys.argv[0] + ': LXR_DATA_DIR needs to be set')
exit(1)
return dir
def getRepoDir():
try:
dir=os.environ['LXR_REPO_DIR']
return os.environ['LXR_REPO_DIR']
except KeyError:
print(sys.argv[0] + ': LXR_REPO_DIR needs to be set')
exit(1)
return dir
def currentProject():
return os.path.basename(os.path.dirname(getDataDir()))