Crates.io | fbenv |
lib.rs | fbenv |
version | 0.1.5 |
source | src |
created_at | 2018-07-08 17:33:36.498216 |
updated_at | 2018-07-08 23:26:33.78543 |
description | Environment management tool |
homepage | |
repository | https://github.com/brocode/fbenv |
max_upload_size | |
id | 73386 |
size | 108,254 |
ATTENTION: Early alpha!
It is direnv but for a more global scope. So if you want to have directory based environments, use direnv
,
but if you want to have an environment for the current shell, you can use fbenv
.
cargo install fbenv
fbenv.toml
to your home directory:[environment1]
SOME_VAR = "foo"
[environment2]
SOME_VAR = "bar"
fbenv ls
to show the keys of all your environmentsfbenv get environment1
to get an output like:
export FBENV=environment1;
export SOME_VAR="foo";
fbenv
:
eval $(fbenv get environment1)
printenv | grep SOME_VAR
should yield "foo"
SOME_VAR = "blubb"
[environment1]
SOME_OTHER_VAR = "bla"
will ignore the variable SOME_VAR
!
fzf
for adding extra sugar to your workflow :)zsh
config:if [[ -x "$(command -v fbenv)" ]];
then
if [[ -x "$(command -v fzf)" ]];
then
eval $(fbenv print-zsh-setup --with-fzf 2>/dev/null);
else
eval $(fbenv print-zsh-setup 2>/dev/null);
fi;
fi;
switch-env
commandWhen you are lucky to use the grml zsh config, you can add the current environment to your prompt:
function fb_env_prompt () {
if [ -n "$FBENV" ];
then
REPLY="fbenv ~ $FBENV "
else
REPLY=""
fi;
}
grml_theme_add_token longpath '%60<..<%~%<<' '%B' '%b
grml_theme_add_token magentahost '%m' '%F{magenta}' '%f'
grml_theme_add_token greenuser '%n' '%F{green}' '%f'
grml_theme_add_token gtprompt "»"
grml_theme_add_token space ' '
grml_theme_add_token fb-env -f fb_env_prompt '%F{cyan}' '%f'
zstyle ':prompt:grml:left:setup' items date space time fb-env change-root greenuser at magentahost newline gtprompt space
This will look like this:
2018-07-08 22:46:13 fbenv ~ environment1 user@host
»