diff --git a/src/cli.rs b/src/cli.rs index b06e5089b6..b6bba49189 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -69,7 +69,7 @@ fn load_plugin(path: &std::path::Path, context: &mut Context) -> Result<(), Shel Ok(jrpc) => match jrpc.params { Ok(params) => { let fname = path.to_string_lossy(); - println!("Loaded: {} from {}", params.name, fname); + //println!("Loaded: {} from {}", params.name, fname); if params.is_filter { let fname = fname.to_string(); context.add_commands(vec![command( @@ -129,12 +129,14 @@ 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"); let _ = load_plugins_in_dir(&path, context); + */ Ok(()) } diff --git a/src/commands/plugin.rs b/src/commands/plugin.rs index dad8459410..9be9dad7a9 100644 --- a/src/commands/plugin.rs +++ b/src/commands/plugin.rs @@ -33,17 +33,6 @@ pub enum NuResult { } pub fn filter_plugin(path: String, args: CommandArgs) -> Result { - //let mut path = std::path::PathBuf::from("."); - //path.push("target"); - //path.push("debug"); - //path.push(format!("nu_plugin_{}", plugin_name)); - - // path = if path.exists() { - // path - // } else { - // std::path::PathBuf::from(format!("nu_plugin_{}", plugin_name)) - // }; - let mut child = std::process::Command::new(path) .stdin(std::process::Stdio::piped()) .stdout(std::process::Stdio::piped()) @@ -130,17 +119,6 @@ pub fn filter_plugin(path: String, args: CommandArgs) -> Result Result<(), ShellError> { - // let mut path = std::path::PathBuf::from("."); - // path.push("target"); - // path.push("debug"); - // path.push(format!("nu_plugin_{}", plugin_name)); - - // path = if path.exists() { - // path - // } else { - // std::path::PathBuf::from(format!("nu_plugin_{}", plugin_name)) - // }; - let mut child = std::process::Command::new(path) .stdin(std::process::Stdio::piped()) .spawn() diff --git a/tests/inc_plugin.out b/tests/inc_plugin.out new file mode 100644 index 0000000000..b4de394767 --- /dev/null +++ b/tests/inc_plugin.out @@ -0,0 +1 @@ +11 diff --git a/tests/inc_plugin.txt b/tests/inc_plugin.txt new file mode 100644 index 0000000000..111eb6e42f --- /dev/null +++ b/tests/inc_plugin.txt @@ -0,0 +1,3 @@ +cd tests +open test.json | get glossary.GlossDiv.GlossList.GlossEntry.Height | inc | echo $it +exit \ No newline at end of file diff --git a/tests/tests.rs b/tests/tests.rs index 3974e2f80f..011fdffb3b 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -112,4 +112,9 @@ mod tests { fn unit() { test_helper("unit"); } + + #[test] + fn inc_plugin() { + test_helper("inc_plugin"); + } }