2 stable releases
1.0.1 | Jul 5, 2023 |
---|
#429 in Cargo plugins
5KB
56 lines
This is a tiny utility that injects env variables before running cargo commands.
I built this utility specifically because IntelliJ Rust does not support
.env
files, nor does the EnvFile
plugin support Rust.
Otherwise, I recommend adding env variables through just
, your shell, or other means.
Usage
# Runs `cargo run` with env coming from `.env`
cargo dotenv run
# Runs `cargo check` with env coming from `.env.production`
cargo dotenv -e .env.production check
You can run dotenv recursively arbitrarily. This fact is useless, but I find it amusing.
cargo dotenv dotenv dotenv dotenv dotenv dotenv dotenv dotenv dotenv check
Installation
cargo install cargo-dotenv
Issue Tracker
- EnvFile: https://github.com/ashald/EnvFile/issues/71
- IntelliJ (YouTrack): https://youtrack.jetbrains.com/issue/IDEA-137820
Dependencies
~1.1–1.7MB
~31K SLoC