From eb57f0afaef0c3418c2c10cf223dfa01def1ea6f Mon Sep 17 00:00:00 2001 From: Derek Schaller Date: Fri, 23 Feb 2018 17:14:33 -0800 Subject: [PATCH] show warning if lockfile doesn't exist on clean --- pipenv/core.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pipenv/core.py b/pipenv/core.py index b13cece9..52e7c4d5 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -2302,6 +2302,12 @@ def do_clean( # Ensure that virtualenv is available. ensure_project(three=three, python=python, validate=False) + if not project.lockfile_exists: + click.echo( + '{0}: Could not find Pipfile.lock'.format(crayons.red('Warning')) + ) + sys.exit(1) + installed_packages = delegator.run( '{0} freeze'.format(which('pip')) ).out.strip().split('\n') @@ -2344,4 +2350,4 @@ def do_clean( # Uninstall the package. delegator.run('{0} uninstall {1} -y'.format(which('pip'), apparent_bad_package)) - sys.exit(int(success)) \ No newline at end of file + sys.exit(int(success))