cpp-dotenv
cpp-dotenv copied to clipboard
No error given for missing .env file
Thanks for a great library!
I noticed that if the .env file does not exist, it is silently ignored and there is no way to check if the file was actually found. I think the dotenv class should keep a status value to indicate if the file was found & parsed or not. There should be a way to query the status, for example:
env.load_dotenv();
if(!env.good()) throw std::runtime_error(".env file was not found"):
+1
I think if added it should be more like env.file_found() some setups like docker compose, might pass all the settings through system enviroment, so you can have a valid config with no .env file