[setup] add 'ALICEVISION_BIN_PATH' env. var to path

Enables to add AliceVision binaries folder to path (without having to manipulate PATH) using ALICEVISION_BIN_PATH.
This commit is contained in:
Yann Lanthony 2019-06-17 13:06:18 +02:00
parent eb8023e02c
commit ff70b0bcd3
No known key found for this signature in database
GPG key ID: 519FAE6DF7A70642

View file

@ -67,6 +67,9 @@ def setupEnvironment():
val (str or list of str): the path(s) to add
index (int): insertion index
"""
if not val:
return
paths = os.environ.get(var, "").split(os.pathsep)
if not isinstance(val, (list, tuple)):
@ -108,3 +111,5 @@ def setupEnvironment():
if key not in os.environ and os.path.exists(value):
logging.info("Set {}: {}".format(key, value))
os.environ[key] = value
else:
addToEnvPath("PATH", os.environ.get("ALICEVISION_BIN_PATH", ""))