Crates.io | oneenv |
lib.rs | oneenv |
version | 0.1.0 |
source | src |
created_at | 2024-06-19 09:44:54.434001 |
updated_at | 2024-06-19 09:44:54.434001 |
description | One Env: manage local env vars in a single file |
homepage | |
repository | https://github.com/sergey-melnychuk/oneenv |
max_upload_size | |
id | 1276702 |
size | 3,929 |
All local env vars in a single file.
cargo build --release
cp ./target/release/oneenv ~/.cargo/bin/
$ vim ~/.zshrc
## https://superuser.com/a/735969
precmd() {
oneenv | while read -r line; do eval "export $line"; done
}
$ cat ~/.oneenv
/Users/john.doe/this:
API_KEY=qweqweqwe
/Users/john.doe/that:
ANSWER=42
$ cd /Users/john.doe/this
$ echo "https://cool.api/${API_KEY}"
https://cool.api/qweqweqwe
$ cd /Users/john.doe/that
$ echo $ANSWER
42