Crates.io | cargo-env-run |
lib.rs | cargo-env-run |
version | |
source | src |
created_at | 2024-09-14 17:08:47.042349 |
updated_at | 2024-12-05 02:38:49.124099 |
description | Like dotenv but with `.cargo/config.toml` files |
homepage | |
repository | https://github.com/qtfkwk/cargo-env-run |
max_upload_size | |
id | 1374944 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
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.