Merge pull request #243 from nateprewitt/only_shell_once

Only spawn shell once
This commit is contained in:
2017-03-01 13:24:28 -08:00
committed by GitHub
+4
View File
@@ -868,6 +868,10 @@ def shell(three=None, python=False, compat=False, shell_args=None):
# Ensure that virtualenv is available.
ensure_project(three=three, python=python, validate=False)
if 'PIPENV_ACTIVE' in os.environ:
click.echo(crayons.yellow('Shell already activated. No action taken to avoid nested environments.'))
return
# Set an environment variable, so we know we're in the environment.
os.environ['PIPENV_ACTIVE'] = '1'