diff --git a/Cargo.lock b/Cargo.lock index 32b7d0bbb0..c3a7183cf0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1487,7 +1487,7 @@ dependencies = [ [[package]] name = "nu" -version = "0.5.0" +version = "0.5.1" dependencies = [ "ansi_term 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", "app_dirs 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index cca4fbce83..5dc5131bb4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nu" -version = "0.5.0" +version = "0.5.1" authors = ["Yehuda Katz ", "Jonathan Turner ", "Andrés N. Robalino "] description = "A shell for the GitHub era" license = "MIT" diff --git a/src/cli.rs b/src/cli.rs index e5231afd10..483ee332ea 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -23,7 +23,6 @@ use crate::prelude::*; use log::{debug, log_enabled, trace}; use rustyline::error::ReadlineError; use rustyline::{self, config::Configurer, config::EditMode, ColorMode, Config, Editor}; -use std::env; use std::error::Error; use std::io::{BufRead, BufReader, Write}; use std::iter::Iterator; @@ -119,13 +118,6 @@ fn load_plugin(path: &std::path::Path, context: &mut Context) -> Result<(), Shel fn search_paths() -> Vec { let mut search_paths = Vec::new(); - match env::var_os("PATH") { - Some(paths) => { - search_paths = env::split_paths(&paths).collect::>(); - } - None => println!("PATH is not defined in the environment."), - } - #[cfg(debug_assertions)] { // Use our debug plugins in debug mode @@ -140,6 +132,15 @@ fn search_paths() -> Vec { #[cfg(not(debug_assertions))] { + use std::env; + + match env::var_os("PATH") { + Some(paths) => { + search_paths = env::split_paths(&paths).collect::>(); + } + None => println!("PATH is not defined in the environment."), + } + // Use our release plugins in release mode let mut path = std::path::PathBuf::from("."); path.push("target");