Fix when PIPENV_SHELL is empty

This commit is contained in:
Alex Cunha
2017-10-03 21:48:08 -05:00
parent 7b2144cd21
commit caa23d8878
+6 -6
View File
@@ -1155,11 +1155,11 @@ def activate_virtualenv(source=True):
suffix = ''
# Support for fish shell.
if 'fish' in PIPENV_SHELL:
if PIPENV_SHELL and 'fish' in PIPENV_SHELL:
suffix = '.fish'
# Support for csh shell.
if 'csh' in PIPENV_SHELL:
if PIPENV_SHELL and 'csh' in PIPENV_SHELL:
suffix = '.csh'
# Escape any spaces located within the virtualenv path to allow
@@ -1597,9 +1597,9 @@ def cli(
sys.exit()
if completion:
try:
if PIPENV_SHELL:
os.environ['_PIPENV_COMPLETE'] = 'source-{0}'.format(PIPENV_SHELL.split(os.sep)[-1])
except KeyError:
else:
click.echo(
'Please ensure that the {0} environment variable '
'is set.'.format(crayons.normal('SHELL', bold=True)), err=True)
@@ -1988,9 +1988,9 @@ def do_shell(three=None, python=False, fancy=False, shell_args=None):
# Compatibility mode:
if compat:
try:
if PIPENV_SHELL:
shell = os.path.abspath(PIPENV_SHELL)
except KeyError:
else:
click.echo(
crayons.red(
'Please ensure that the {0} environment variable '