cargo-env-run

Crates.iocargo-env-run
lib.rscargo-env-run
version0.3.0
sourcesrc
created_at2024-09-14 17:08:47.042349
updated_at2024-10-26 01:07:37.5306
descriptionLike dotenv but with `.cargo/config.toml` files
homepage
repositoryhttps://github.com/qtfkwk/cargo-env-run
max_upload_size
id1374944
size23,159
(qtfkwk)

documentation

README

About

Like dotenv but with .cargo/config.toml files

$ env |grep ^CARGO_ENV_RUN_TEST
$ cat .cargo/config.toml
[env]
CARGO_ENV_RUN_TEST = "IT WORKS"
$ cargo env-run env |grep ^CARGO_ENV_RUN_TEST
CARGO_ENV_RUN_TEST=IT WORKS

This crate/utility does not intend to replace dotenv or similar utilites, and was originally designed to overcome Helix Editor's inability to recognize a compile-time environment variable being set in a .cargo/config.toml file instead of the current environment. Using this utility, the fix for this scenario is to prefix the hx src/main.rs command with cargo env-run which loads environment variables from .cargo/config.toml files and then runs the given command.

Commit count: 3

cargo fmt