From 8dcf1ba6a5305109d07cda85a1bc5b22f7b6167d Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Mon, 14 Aug 2017 17:55:13 +0100 Subject: [PATCH] Bootstrap: Make sure that _env_root is an absolute path If the environment variable $WA_USER_DIRECTORY is not set `_env_root` is automatically generated from the path expansion of `~`. In some cases if a home directory is not avaliable for the user this may result in an empty string. This commit ensure that '_env_root' is still an absolute path using the current working directory. --- wlauto/core/bootstrap.py | 1 + 1 file changed, 1 insertion(+) diff --git a/wlauto/core/bootstrap.py b/wlauto/core/bootstrap.py index 8da24255..e4f4b69f 100644 --- a/wlauto/core/bootstrap.py +++ b/wlauto/core/bootstrap.py @@ -176,6 +176,7 @@ def init_environment(env_root, dep_dir, extension_paths, overwrite_existing=Fals _env_root = os.getenv('WA_USER_DIRECTORY', os.path.join(_user_home, '.workload_automation')) +_env_root = os.path.abspath(_env_root) _dep_dir = os.path.join(_env_root, 'dependencies') _extension_paths = [os.path.join(_env_root, ext.default_path) for ext in _extensions] _env_var_paths = os.getenv('WA_EXTENSION_PATHS', '')