You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using cascading env variables, you might end up with a lot of .env files. It is then common to group the .env files in a folder. Would it be possible to add a flag for specifying where dotenv should look for .env files? I suggest -d <dir>. For consistency, I think it should also work without -c, though that is probably the main use case.
# Load vars/.env (-d without -e or -c)
dotenv -d vars <cmd># Load vars/.env2 (-d combined with -e)
dotenv -d vars -e .env2 <cmd># Load env/.env.local and env/.env (-d combined with -c)
dotenv -d env -c <cmd>
The text was updated successfully, but these errors were encountered:
After looking at the source code, I'm not sure -d is needed after all. Since -c cascades all files added with -e, the behavior provided by -d can already be achieved with the current functionality:
# Load vars/.env
dotenv -e vars/.env <cmd># Load vars/.env2
dotenv -e vars/.env2 <cmd># Load env/.env.local and env/.env (the use case I thought wasn't possible without -d)
dotenv -e env/.env -c <cmd>
Yeah, I guess it might be better to keep the cli clean and lean and not add it. I guess if we really want to improve something, we could update the readme.
When using cascading env variables, you might end up with a lot of
.env
files. It is then common to group the.env
files in a folder. Would it be possible to add a flag for specifying wheredotenv
should look for.env
files? I suggest-d <dir>
. For consistency, I think it should also work without-c
, though that is probably the main use case.The text was updated successfully, but these errors were encountered: