Create virtualenvs directory if it does not exist

This commit is contained in:
Michael Hoang
2018-09-21 11:11:46 +10:00
committed by Tzu-ping Chung
parent 9084792db0
commit 65ccd765b6
+4 -1
View File
@@ -1281,7 +1281,10 @@ def get_workon_home():
workon_home = os.path.join(
os.environ.get("XDG_DATA_HOME", "~/.local/share"), "virtualenvs"
)
return Path(os.path.expandvars(workon_home)).expanduser()
# Create directory if it does not already exist
expanded_path = Path(os.path.expandvars(workon_home)).expanduser()
mkdir_p(str(expanded_path))
return expanded_path
def is_virtual_environment(path):