plugin path for $nu (#398)

This commit is contained in:
Fernando Herrera
2021-12-02 06:35:32 +00:00
committed by GitHub
parent 45eba8b922
commit 99de2b1d77
3 changed files with 17 additions and 3 deletions

View File

@ -507,6 +507,17 @@ pub fn eval_variable(
});
}
#[cfg(feature = "plugin")]
if let Some(path) = &engine_state.plugin_signatures {
if let Some(path_str) = path.to_str() {
output_cols.push("plugin-path".into());
output_vals.push(Value::String {
val: path_str.into(),
span,
});
}
}
if let Ok(cwd) = std::env::var("PWD") {
output_cols.push("pwd".into());
output_vals.push(Value::String { val: cwd, span })