envy-cli 0.6.0

A magical little tool that takes care of your environment settings.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use anyhow::Result;
use std::env::current_exe;

static FISH_HOOK: &str = r#"
function __direnv_export_eval --on-event fish_prompt;
	eval ("{{.SelfPath}}" export fish);
end
"#;

pub struct Fish;

impl Fish {
    pub fn hook() -> Result<String> {
        Ok(FISH_HOOK.replace("{{.SelfPath}}", &current_exe()?.to_string_lossy()))
    }
}