mirror of
https://github.com/nushell/nushell
synced 2024-12-26 04:53:09 +00:00
Merge pull request #660 from androbtech/plugin-search-paths
Permit Nu find and pick up development plugins if there are any first.
This commit is contained in:
commit
970cc3c24d
1 changed files with 11 additions and 2 deletions
13
src/cli.rs
13
src/cli.rs
|
@ -113,7 +113,10 @@ fn search_paths() -> Vec<std::path::PathBuf> {
|
|||
let mut path = std::path::PathBuf::from(".");
|
||||
path.push("target");
|
||||
path.push("debug");
|
||||
search_paths.push(path);
|
||||
|
||||
if path.exists() {
|
||||
search_paths.push(path);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
|
@ -122,9 +125,15 @@ fn search_paths() -> Vec<std::path::PathBuf> {
|
|||
let mut path = std::path::PathBuf::from(".");
|
||||
path.push("target");
|
||||
path.push("release");
|
||||
search_paths.push(path);
|
||||
|
||||
if path.exists() {
|
||||
search_paths.push(path);
|
||||
}
|
||||
}
|
||||
|
||||
// permit Nu finding and picking up development plugins
|
||||
// if there are any first.
|
||||
search_paths.reverse();
|
||||
search_paths
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue