adding check for windows then using Scripts instead of bin

This commit is contained in:
Jason Williams 2016-01-05 00:22:28 +00:00 committed by Lars Bergstrom
parent 095658e098
commit 13d98f153a
6 changed files with 61 additions and 41 deletions

View file

@ -92,7 +92,9 @@ def _activate_virtualenv(topdir):
if python is None:
sys.exit("Python is not installed. Please install it prior to running mach.")
activate_path = os.path.join(virtualenv_path, "bin", "activate_this.py")
# Virtualenv calls its scripts folder "bin" on linux/OSX but "Scripts" on Windows, detect which one then use that
script_dir = "Scripts" if os.name == "nt" else "bin"
activate_path = os.path.join(virtualenv_path, script_dir, "activate_this.py")
if not (os.path.exists(virtualenv_path) and os.path.exists(activate_path)):
virtualenv = _get_exec(*VIRTUALENV_NAMES)
if virtualenv is None: