expand tilde when reading plugin_dirs (#4052)

This commit is contained in:
hedonihilist 2021-10-02 16:38:21 +08:00 committed by GitHub
parent 92c855a412
commit 62c5df5fc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

1
Cargo.lock generated
View file

@ -2566,6 +2566,7 @@ dependencies = [
"nu-engine",
"nu-errors",
"nu-parser",
"nu-path",
"nu-protocol",
"nu-source",
"nu-stream",

View file

@ -21,6 +21,7 @@ nu-protocol = { version = "0.37.1", path="../nu-protocol" }
nu-source = { version = "0.37.1", path="../nu-source" }
nu-stream = { version = "0.37.1", path="../nu-stream" }
nu-ansi-term = { version = "0.37.1", path="../nu-ansi-term" }
nu-path = { version = "0.37.1", path="../nu-path" }
indexmap ="1.6.1"
log = "0.4.14"

View file

@ -24,6 +24,7 @@ use rustyline::{self, error::ReadlineError};
use nu_errors::ShellError;
use nu_parser::ParserScope;
use nu_path::expand_tilde;
use nu_protocol::{hir::ExternalRedirection, ConfigPath, UntaggedValue, Value};
use log::trace;
@ -54,7 +55,7 @@ pub fn search_paths() -> Vec<std::path::PathBuf> {
{
for pipeline in pipelines {
if let Ok(plugin_dir) = pipeline.as_string() {
search_paths.push(PathBuf::from(plugin_dir));
search_paths.push(expand_tilde(plugin_dir));
}
}
}