mirror of
https://github.com/nushell/nushell.git
synced 2025-01-14 02:08:51 +01:00
Fix having to clean directories when switching between release and debug
This commit is contained in:
parent
e32291d0d7
commit
716517c13f
11
src/cli.rs
11
src/cli.rs
@ -121,19 +121,24 @@ fn load_plugins(context: &mut Context) -> Result<(), ShellError> {
|
|||||||
None => println!("PATH is not defined in the environment."),
|
None => println!("PATH is not defined in the environment."),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Also use our debug output for now
|
#[cfg(debug_assertions)]
|
||||||
|
{
|
||||||
|
// Use our debug plugins in debug mode
|
||||||
let mut path = std::path::PathBuf::from(".");
|
let mut path = std::path::PathBuf::from(".");
|
||||||
path.push("target");
|
path.push("target");
|
||||||
path.push("debug");
|
path.push("debug");
|
||||||
|
|
||||||
let _ = load_plugins_in_dir(&path, context);
|
let _ = load_plugins_in_dir(&path, context);
|
||||||
|
}
|
||||||
|
|
||||||
// Also use our release output for now
|
#[cfg(not(debug_assertions))]
|
||||||
|
{
|
||||||
|
// Use our release plugins in release mode
|
||||||
let mut path = std::path::PathBuf::from(".");
|
let mut path = std::path::PathBuf::from(".");
|
||||||
path.push("target");
|
path.push("target");
|
||||||
path.push("release");
|
path.push("release");
|
||||||
|
|
||||||
let _ = load_plugins_in_dir(&path, context);
|
let _ = load_plugins_in_dir(&path, context);
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user