-
Notifications
You must be signed in to change notification settings - Fork 698
Closed
Labels
Description
Describe the bug
Direnv allows for variable expansion in .env
files. The PWD
environment variable is however removed in the direnv process from the environment variables to not interfere with finding .envrc.
To Reproduce
Steps to reproduce the behavior:
In any folder put the following two files:
dotenv
TEST1=$PWD
TEST2=$HOME
TEST1 will be empty, while TEST2 will have expanded properly.
Expected behavior
PWD in .env files should expand to the folder the .env file resides in.
Environment
- OS: [e.g. macOS Ventura]
- Shell: [zsh]
- Direnv version [e.g. 2.32.2]
Additional context
Other .env impementations don't have this issue. I've checked the following, which all seem to work as expected:
https://github.com/bkeepers/dotenv
https://github.com/motdotla/dotenv-expand
Both work as expected and expand PWD properly.
seanorama, joeriddles and NikolayXHDseanorama