adeharo9 / cpp-dotenv

Loads environment variables from .env files for C++ projects.
BSD 3-Clause "New" or "Revised" License
89 stars 21 forks source link

Add to README that only executable-level .env is auto-configured #11

Closed adeharo9 closed 4 years ago

adeharo9 commented 4 years ago

Only .env files at executable level are loaded on auto-configuration. Add it explicitly to README.md so everyone loads their own .env files correctly.

felixgeissler commented 4 years ago

A neat feature would be to provide a dedicated directory for the .env file as well. This might come handy in big projects stacks.

adeharo9 commented 4 years ago

@felixgeissler it is possible to load any file as a dotenv file regardless of its scope. What I meant is that, during auto-configuration, the env object tries to load a hypothetical .env file located at the same level where the executable is located (in case it does not exist, it fails silently), but there is no problem on loading as many .env files from different locations as needed.

adeharo9 commented 4 years ago

After recent issues with deferred dynamic initialization and static initialization order fiasco caused by auto-configuration (as commented in #14 ), this feature is going to be dropped on the next release, and thus this issue no longer applies.