Skip to content
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

Add support for .env.development file #894

Merged
merged 6 commits into from
May 11, 2020

Conversation

RaeesBhatti
Copy link
Contributor

- Summary
Fixes: #876

- Test plan

  • Tests added

- Description for the changelog

  • Add function getEnvFile to return .env.development or fallback to .env file
  • Add tests for getEnvFile
  • Pass project directory to detectors

- A picture of a cute animal (not mandatory but encouraged)
🦆

const envFile = path.resolve(projectDir, '.env')

try {
if ((await fileStat(envDevelopmentFile)).isFile()) return envDevelopmentFile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That could be used too: https://github.com/sindresorhus/locate-path#usage

return locatePath([envDevelopmentFile, envFile])

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏽

@RaeesBhatti RaeesBhatti merged commit d7ec49b into master May 11, 2020
@RaeesBhatti RaeesBhatti deleted the raees/env-development-support branch May 11, 2020 19:59
@wesbos
Copy link

wesbos commented May 11, 2020

:D thank you for this!

@RaeesBhatti
Copy link
Contributor Author

@wesbos Glad you found it useful 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support .env.development or config of dotenv
3 participants