mirror of
https://github.com/nushell/nushell.git
synced 2024-12-23 07:30:13 +01:00
Simplify plugin directory scanning (#1910)
This commit is contained in:
parent
fe01a223a4
commit
3f9871f60d
@ -110,13 +110,19 @@ fn search_paths() -> Vec<std::path::PathBuf> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(debug_assertions))]
|
if let Ok(config) = crate::data::config::config(Tag::unknown()) {
|
||||||
{
|
if let Some(plugin_dirs) = config.get("plugin_dirs") {
|
||||||
match env::var_os("PATH") {
|
if let Value {
|
||||||
Some(paths) => {
|
value: UntaggedValue::Table(pipelines),
|
||||||
search_paths.extend(env::split_paths(&paths).collect::<Vec<_>>());
|
..
|
||||||
|
} = plugin_dirs
|
||||||
|
{
|
||||||
|
for pipeline in pipelines {
|
||||||
|
if let Ok(plugin_dir) = pipeline.as_string() {
|
||||||
|
search_paths.push(PathBuf::from(plugin_dir));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
None => println!("PATH is not defined in the environment."),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user