mirror of
https://github.com/containers/podman-compose.git
synced 2025-01-23 22:39:04 +01:00
fix: check .env
in current dir with isfile
instead of exists
This prevents cases in which an `.env` directory exists, for example in Python projects with a local virtual environment, and then dotenv gets passed the directory path as input.
This commit is contained in:
parent
08dd36f4c1
commit
75a63df954
@ -876,7 +876,7 @@ class PodmanCompose:
|
||||
|
||||
|
||||
dotenv_path = os.path.join(dirname, ".env")
|
||||
if os.path.exists(dotenv_path):
|
||||
if os.path.isfile(dotenv_path):
|
||||
with open(dotenv_path, 'r') as f:
|
||||
dotenv_ls = [l.strip() for l in f if l.strip() and not l.startswith('#')]
|
||||
dotenv_dict = dict([l.split("=", 1) for l in dotenv_ls if "=" in l])
|
||||
|
Loading…
Reference in New Issue
Block a user