Merge pull request #477 from jonathandturner/fix_dbg_release

Fix having to clean directories when switching between release and debug
This commit is contained in:
Jonathan Turner 2019-08-27 14:11:30 +12:00 committed by GitHub
commit 5313fc5568
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,19 +121,24 @@ fn load_plugins(context: &mut Context) -> Result<(), ShellError> {
None => println!("PATH is not defined in the environment."),
}
// Also use our debug output for now
let mut path = std::path::PathBuf::from(".");
path.push("target");
path.push("debug");
#[cfg(debug_assertions)]
{
// Use our debug plugins in debug mode
let mut path = std::path::PathBuf::from(".");
path.push("target");
path.push("debug");
let _ = load_plugins_in_dir(&path, context);
}
let _ = load_plugins_in_dir(&path, context);
#[cfg(not(debug_assertions))]
{
// Use our release plugins in release mode
let mut path = std::path::PathBuf::from(".");
path.push("target");
path.push("release");
// Also use our release output for now
let mut path = std::path::PathBuf::from(".");
path.push("target");
path.push("release");
let _ = load_plugins_in_dir(&path, context);
let _ = load_plugins_in_dir(&path, context);
}
Ok(())
}