Skip to content

Commit

Permalink
Improve message for working under root directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
frostming committed Dec 17, 2018
1 parent 94e7c97 commit c0c4683
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pipenv/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
PIPENV_PIPFILE, PIPENV_PYTHON, PIPENV_TEST_INDEX, PIPENV_VENV_IN_PROJECT,
is_in_virtualenv
)
from .exceptions import PipenvUsageError
from .utils import (
cleanup_toml, convert_toml_outline_tables, find_requirements,
get_canonical_names, get_url_name, get_workon_home, is_editable,
Expand Down Expand Up @@ -218,6 +219,10 @@ def _build_package_list(self, package_section):
def name(self):
if self._name is None:
self._name = self.pipfile_location.split(os.sep)[-2]
if not self._name:
raise PipenvUsageError(
"Pipenv is not intended to work under root directory, please choose another path."
)
return self._name

@property
Expand Down

0 comments on commit c0c4683

Please sign in to comment.