dotenvy
dotenvy copied to clipboard
Overriding files
Coming from bkeepers/dotenv, is there a way to use these files too: bkeepers/dotenv#what-other-env-files-can-i-use?
| Hierarchy Priority | Filename | Environment | Should I .gitignoreit? | Notes |
|---|---|---|---|---|
| 1st (highest) | .env.development.local | Development | Yes! | Local overrides of environment-specific settings. |
| 1st | .env.test.local | Test | Yes! | Local overrides of environment-specific settings. |
| 1st | .env.production.local | Production | Yes! | Local overrides of environment-specific settings. |
| 2nd | .env.local | Wherever the file is | Definitely. | Local overrides. This file is loaded for all environments except test. |
| 3rd | .env.development | Development | No. | Shared environment-specific settings |
| 3rd | .env.test | Test | No. | Shared environment-specific settings |
| 3rd | .env.production | Production | No. | Shared environment-specific settings |
| Last | .env | All Environments | Depends (See below) | The Original® |
From: https://github.com/dotenv-rs/dotenv/issues/41
The specific filenames like .env.development and .env.local are not supported in this crate but you can achieve the same functionality using "from path" functions and override functions. You can see the list of functions on doc.rs.