Fix cli option usage error

Fix IndexError exception when `more_packages` is empty and add the more
informal message for argument usage.

To reproduce this issue `pipenv install -e`
This commit is contained in:
Max Krivich
2018-06-20 13:17:13 +03:00
committed by Dan Ryan
parent 2a9bb815ff
commit 252be32578
+2
View File
@@ -1889,6 +1889,8 @@ def do_install(
# Capture -e argument and assign it to following package_name.
more_packages = list(more_packages)
if package_name == '-e':
if not more_packages:
raise click.BadArgumentUsage('Please provide path to setup.py')
package_name = ' '.join([package_name, more_packages.pop(0)])
# capture indexes and extra indexes
line = [package_name] + more_packages