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

Don't parse correct for ENV which value is another defined env? #30

Closed
zw963 opened this issue Mar 20, 2023 · 2 comments · Fixed by #31
Closed

Don't parse correct for ENV which value is another defined env? #30

zw963 opened this issue Mar 20, 2023 · 2 comments · Fixed by #31

Comments

@zw963
Copy link
Contributor

zw963 commented Mar 20, 2023

Following ENV not work as expected.

# .env
APP_PORT=3000
APP_NAME=production_line_report
LUCKY_ENV=development
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_NAME=${APP_NAME}_${LUCKY_ENV}

the expected DB_NAME is product_line_report_development, but the actually is: ${APP_NAME}_${LUCKY_ENV}.

If source ~/.env use bash shell, the result is expected.

So, i consider we should support this, give the user the least surprise

@zw963
Copy link
Contributor Author

zw963 commented Mar 20, 2023

I create a PR for fix this. #31

@jwoertink
Copy link
Member

I actually would never expect this to work. I've never seen this sort of interpolation in a .env file before. I do like the change, but I also want to be clear that this shard is not intended to be a bash-like ENV loader. This shard will eventually change #1 to be very specific to Lucky's needs.

But for now, I think this is a nice change and we can add it in 👍

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 a pull request may close this issue.

2 participants