Skip to content

Follow dotenv-flow variable precedence #492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jleem99
Copy link

@jleem99 jleem99 commented Feb 28, 2024

Link to issue

Resolves #491

Description of changes being made

  • Change the order of merging multiple variables to:

    1. Default env file (.env)
    2. Local env file (.env.local)
    3. Mode env file (.env.my-env)
    4. Mode local env file (.env.my-env.local)
    5. Command line variables
  • Add test cases for the variable precedence.

Follow dotenv-flow variable precedence when multiple env files are
present.

The order of precedence is as follows (Low to high):
  1. Default env file (.env)
  2. Local env file (.env.local)
  3. Mode env file (.env.my-env)
  4. Mode local env file (.env.my-env.local)
  5. Command line variables
@jleem99
Copy link
Author

jleem99 commented Mar 7, 2024

@goatandsheep I'd love if you could take a look when you get a chance. Thanks!

@goatandsheep
Copy link
Owner

Sorry it will take a little bit longer. This looks ok but I want to do some local testing

@goatandsheep
Copy link
Owner

i need a little bit longer. sorry for the delays.

@goatandsheep goatandsheep self-requested a review March 20, 2024 13:41
Copy link

stale bot commented Apr 26, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Apr 26, 2025
Copy link

codecov bot commented Apr 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (1e86fec) to head (2c0e6f2).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #492   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           84        87    +3     
=========================================
+ Hits            84        87    +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Follow dotenv-flow variable precedence
2 participants