mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #243 from nateprewitt/only_shell_once
Only spawn shell once
This commit is contained in:
@@ -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'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user