forked from extern/nushell
Add LIB_DIRS and PLUGIN_DIRS (#4829)
* Add LIB_DIRS and PLUGIN_DIRS * Put plugin dirs behind plugin feature
This commit is contained in:
@ -16,6 +16,8 @@ use std::path::Path;
|
||||
#[cfg(feature = "plugin")]
|
||||
use std::path::PathBuf;
|
||||
|
||||
static PWD_ENV: &str = "PWD";
|
||||
|
||||
// Tells whether a decl etc. is visible or not
|
||||
#[derive(Debug, Clone)]
|
||||
struct Visibility {
|
||||
@ -1175,11 +1177,15 @@ impl<'a> StateWorkingSet<'a> {
|
||||
let pwd = self
|
||||
.permanent_state
|
||||
.env_vars
|
||||
.get("PWD")
|
||||
.get(PWD_ENV)
|
||||
.expect("internal error: can't find PWD");
|
||||
pwd.as_string().expect("internal error: PWD not a string")
|
||||
}
|
||||
|
||||
pub fn get_env(&self, name: &str) -> Option<&Value> {
|
||||
self.permanent_state.env_vars.get(name)
|
||||
}
|
||||
|
||||
pub fn set_variable_type(&mut self, var_id: VarId, ty: Type) {
|
||||
let num_permanent_vars = self.permanent_state.num_vars();
|
||||
if var_id < num_permanent_vars {
|
||||
|
Reference in New Issue
Block a user