dotenv-exec-0.1.0 is not a library.
dotenv-exec
Simple Rust wrapper around execpv (through std::os::unix::process::CommandExt) and dotenv-rs for unix systems.
This will execute a program populating environment variables from .env files. By default it will look up a file named .env in the current directory or any of its parents (you can disable this with --no-default) and load any env file specified with -f / --file in that order.
All formatting, substitution and ordering rules are the same as dotenv-rs.
Examples
# Load .env by default
|
VAR_1=1
VAR_2=2
# Disable this behaviour with --no-default
|
# dotenv-rs does not override already set values (see VAR_1), so the order in
# which files are specified is important.
|
VAR_1=1
VAR_2=2
VAR_3=3
|
VAR_1=0
VAR_3=3
VAR_2=2
# If you generate env file on the fly (e.g. decrypting them), you should use
# IO redirection
|
VAR_1=0
VAR_3=3
TODO
- Publish binary
- Do a bit more testing
- CI -> Github Actions
- Make sure it works with
-f <(...) -
Make sure it works with stdin ((reading from strings rather than files doesn't seem supported for now)-) - Examples
- Consider whether
--no-defaultis the correct approach