Skip to content

Commit

Permalink
actually use the variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ChacheGS committed Mar 11, 2022
1 parent 8dfd58c commit dc79359
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 118 deletions.
3 changes: 2 additions & 1 deletion .idea/dotenv-flow.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions dotenv_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def dotenv_flow(
if base_path is None:
use_cwd = True

env = env not in (..., None) or os.environ.get("PY_ENV", "")

defaults = [".env.defaults", ".env"]
if env not in (..., None):
defaults.append(f".env.{env}")
Expand All @@ -60,11 +62,3 @@ def dotenv_flow(
dotenv_path, override=override, interpolate=interpolate, **kwargs
)
return [e for e in loaded if loaded[e]]


if __name__ == "__main__":

logging.basicConfig(level=logging.DEBUG)
dotenv_flow("test_envs")
for e in ["", "test", "pro", "dev"]:
print(dotenv_flow(e))
Loading

0 comments on commit dc79359

Please sign in to comment.