Bump Nu version and change plugin load logic for debug

This commit is contained in:
Jonathan Turner 2019-11-10 16:44:05 +13:00
parent 9043970e97
commit df302d4bac
3 changed files with 11 additions and 10 deletions

2
Cargo.lock generated
View file

@ -1487,7 +1487,7 @@ dependencies = [
[[package]] [[package]]
name = "nu" name = "nu"
version = "0.5.0" version = "0.5.1"
dependencies = [ dependencies = [
"ansi_term 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "app_dirs 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "nu" name = "nu"
version = "0.5.0" version = "0.5.1"
authors = ["Yehuda Katz <wycats@gmail.com>", "Jonathan Turner <jonathan.d.turner@gmail.com>", "Andrés N. Robalino <andres@androbtech.com>"] authors = ["Yehuda Katz <wycats@gmail.com>", "Jonathan Turner <jonathan.d.turner@gmail.com>", "Andrés N. Robalino <andres@androbtech.com>"]
description = "A shell for the GitHub era" description = "A shell for the GitHub era"
license = "MIT" license = "MIT"

View file

@ -23,7 +23,6 @@ use crate::prelude::*;
use log::{debug, log_enabled, trace}; use log::{debug, log_enabled, trace};
use rustyline::error::ReadlineError; use rustyline::error::ReadlineError;
use rustyline::{self, config::Configurer, config::EditMode, ColorMode, Config, Editor}; use rustyline::{self, config::Configurer, config::EditMode, ColorMode, Config, Editor};
use std::env;
use std::error::Error; use std::error::Error;
use std::io::{BufRead, BufReader, Write}; use std::io::{BufRead, BufReader, Write};
use std::iter::Iterator; use std::iter::Iterator;
@ -119,13 +118,6 @@ fn load_plugin(path: &std::path::Path, context: &mut Context) -> Result<(), Shel
fn search_paths() -> Vec<std::path::PathBuf> { fn search_paths() -> Vec<std::path::PathBuf> {
let mut search_paths = Vec::new(); let mut search_paths = Vec::new();
match env::var_os("PATH") {
Some(paths) => {
search_paths = env::split_paths(&paths).collect::<Vec<_>>();
}
None => println!("PATH is not defined in the environment."),
}
#[cfg(debug_assertions)] #[cfg(debug_assertions)]
{ {
// Use our debug plugins in debug mode // Use our debug plugins in debug mode
@ -140,6 +132,15 @@ fn search_paths() -> Vec<std::path::PathBuf> {
#[cfg(not(debug_assertions))] #[cfg(not(debug_assertions))]
{ {
use std::env;
match env::var_os("PATH") {
Some(paths) => {
search_paths = env::split_paths(&paths).collect::<Vec<_>>();
}
None => println!("PATH is not defined in the environment."),
}
// Use our release plugins in release mode // 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");