mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Allow virtual env creation in dir with leading dash
Invoke pew with a double dash separator ("--"), to make it clear that
the virtualenv name is a positional argument. Since the virtualenv
name includes all or at least the beginning of the directory name,
trying to create a virtualenv in a directory with a leading dash in
its name will cause pew to erroneously parse the virtualenv name as an
optional argument. Adding the separator causes the virtualenv name to
be parsed correctly.
Fixes #439
This commit is contained in:
+2
-1
@@ -914,7 +914,6 @@ def do_create_virtualenv(python=None, site_packages=False):
|
||||
'-m',
|
||||
'pipenv.pew',
|
||||
'new',
|
||||
project.virtualenv_name,
|
||||
'-d',
|
||||
'-a',
|
||||
project.project_directory,
|
||||
@@ -932,6 +931,8 @@ def do_create_virtualenv(python=None, site_packages=False):
|
||||
err=True,
|
||||
)
|
||||
cmd = cmd + ['-p', python]
|
||||
if not project.is_venv_in_project():
|
||||
cmd = cmd + ['--', project.virtualenv_name]
|
||||
# Actually create the virtualenv.
|
||||
with spinner():
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user