-
Notifications
You must be signed in to change notification settings - Fork 691
Fix using PWD in .env files #1052
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
Conversation
This would help a lot! Can we get it merged? |
Just pushed a small fix, otherwise it looks good to go. Let me know what you think! |
This change introduces PWD support to the `dotenv` functionality, so that it can resolve PWD in `.env` files. When .env is loaded, PWD will be set to the same folder that .env file can be found in variable can be used. A user would also expect that the PWD variable is matching the folder that the .env file resides in, and symlinks should not interfere with that either. Fixes direnv#1051
Treat symlinks like bind-mounts.
11ce4d5
to
6deffee
Compare
Hey @zimbatm I'm not entirely sure why the resolving of the symlinks is a problem and got removed. Could you elaborate? Eg. putting a Anyway if there's any good reason for not wanting to resolve symlinks I'd still take PWD support without it, so feel free to merge without supporting resolution of symlinks. |
OK, I've contemplated on it a bit, and realized it works close to as intended with your fix. |
It depends on the usage. Maybe some users want to use the |
The last release was 3 hours before this got merged 🥲 Any ETA for a release including this fix? |
finally got around to do release v2.34.0 |
This change introduces PWD support to the
dotenv
functionality, so that it can resolve PWD in.env
files.When .env is loaded, PWD will be set to the same folder that .env file can be found in variable can be used.
A user would also expect that the PWD variable is matching the folder that the .env file resides in, and symlinks should not interfere with that either.
Fixes #1051