From b44082115314113668ee700f2598324309a92916 Mon Sep 17 00:00:00 2001 From: Rod Xavier Bondoc Date: Wed, 18 Jul 2018 16:24:16 +1000 Subject: [PATCH 1/2] Pass PIPENV_DOTENV_LOCATION directly to load_dotenv if present --- pipenv/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipenv/core.py b/pipenv/core.py index a6372ad2..dc4d2acc 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -150,8 +150,8 @@ def load_dot_env(): if not PIPENV_DONT_LOAD_ENV: # If the project doesn't exist yet, check current directory for a .env file project_directory = project.project_directory or "." - denv = dotenv.find_dotenv( - PIPENV_DOTENV_LOCATION or os.sep.join([project_directory, ".env"]) + denv = PIPENV_DOTENV_LOCATION or dotenv.find_dotenv( + os.sep.join([project_directory, ".env"]) ) if os.path.isfile(denv): click.echo( From 5cbe272550b635f9cdd8f9789c918f911ec60eca Mon Sep 17 00:00:00 2001 From: Rod Xavier Bondoc Date: Wed, 18 Jul 2018 16:45:44 +1000 Subject: [PATCH 2/2] Remove find_dotenv() --- pipenv/core.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pipenv/core.py b/pipenv/core.py index dc4d2acc..af4c9761 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -150,9 +150,8 @@ def load_dot_env(): if not PIPENV_DONT_LOAD_ENV: # If the project doesn't exist yet, check current directory for a .env file project_directory = project.project_directory or "." - denv = PIPENV_DOTENV_LOCATION or dotenv.find_dotenv( - os.sep.join([project_directory, ".env"]) - ) + denv = PIPENV_DOTENV_LOCATION or os.sep.join([project_directory, ".env"]) + if os.path.isfile(denv): click.echo( crayons.normal("Loading .env environment variables…", bold=True),