From bbce020b1a4fcf548083d8d3ad05073553f6a250 Mon Sep 17 00:00:00 2001 From: Josh Holland Date: Thu, 8 Mar 2018 16:55:56 +0000 Subject: [PATCH] Don't run another process to print completion script See #1247. --- pipenv/cli.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index 0759f4f1..582bf0ec 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -48,15 +48,15 @@ def cli( ): if completion: # Handle this ASAP to make shell startup fast. if PIPENV_SHELL: - os.environ['_PIPENV_COMPLETE'] = 'source-{0}'.format(PIPENV_SHELL.split(os.sep)[-1]) + click.echo(click_completion.get_code( + shell=PIPENV_SHELL.split(os.sep)[-1], prog_name='pipenv' + )) else: click.echo( 'Please ensure that the {0} environment variable ' 'is set.'.format(crayons.normal('SHELL', bold=True)), err=True) sys.exit(1) - c = delegator.run('pipenv') - click.echo(c.out) sys.exit(0) from . import core