From db4a181b2abbb885cf83c61d40c43382c1fa21be Mon Sep 17 00:00:00 2001 From: Nate Prewitt Date: Tue, 18 Apr 2017 14:56:26 -0600 Subject: [PATCH] only trigger --ignore-hashes suggestion when relevant --- pipenv/cli.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index d96b9366..22d72f29 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -247,7 +247,9 @@ def do_install_dependencies(dev=False, only=False, bare=False, requirements=Fals if c.return_code != 0: click.echo(crayons.red('An error occured while installing!')) click.echo(crayons.blue(format_pip_error(c.err))) - click.echo(crayons.yellow('You can supply the --ignore-hashes option to \'pipenv install\' to bypass this feature.')) + if 'PACKAGES DO NOT MATCH THE HASHES' in c.err: + click.echo(crayons.yellow('You can supply the --ignore-hashes option to ' + '\'pipenv install\' to bypass this feature.')) sys.exit(c.return_code) if not bare: @@ -259,7 +261,9 @@ def do_install_dependencies(dev=False, only=False, bare=False, requirements=Fals if c.return_code != 0: click.echo(crayons.red('An error occured while installing!')) click.echo(crayons.blue(format_pip_error(c.err))) - click.echo(crayons.yellow('You can supply the --ignore-hashes option to pip install to bypass this feature.')) + if 'PACKAGES DO NOT MATCH THE HASHES' in c.err: + click.echo(crayons.yellow('You can supply the --ignore-hashes option to ' + '\'pipenv install\' to bypass this feature.')) sys.exit(c.return_code) if not bare: