mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 17:05:03 +02:00
nu_cli refactor in preparation for a crate called nu_command (#2907)
* move basic_shell_manager to nu-engine * move basic_evaluation_context to nu-engine * fix failing test in feature which commands/classified/external.rs
This commit is contained in:
@ -538,10 +538,11 @@ mod tests {
|
||||
#[cfg(feature = "which")]
|
||||
use futures::executor::block_on;
|
||||
#[cfg(feature = "which")]
|
||||
use nu_engine::basic_evaluation_context;
|
||||
#[cfg(feature = "which")]
|
||||
use nu_errors::ShellError;
|
||||
#[cfg(feature = "which")]
|
||||
use nu_test_support::commands::ExternalBuilder;
|
||||
|
||||
// async fn read(mut stream: OutputStream) -> Option<Value> {
|
||||
// match stream.try_next().await {
|
||||
// Ok(val) => {
|
||||
@ -561,8 +562,8 @@ mod tests {
|
||||
let cmd = ExternalBuilder::for_name("i_dont_exist.exe").build();
|
||||
|
||||
let input = InputStream::empty();
|
||||
let mut ctx = crate::cli::basic_evaluation_context()
|
||||
.expect("There was a problem creating a basic context.");
|
||||
let mut ctx =
|
||||
basic_evaluation_context().expect("There was a problem creating a basic context.");
|
||||
|
||||
assert!(
|
||||
run_external_command(cmd, &mut ctx, input, ExternalRedirection::Stdout)
|
||||
|
@ -1,9 +1,10 @@
|
||||
use crate::prelude::*;
|
||||
use nu_engine::basic_evaluation_context;
|
||||
use nu_engine::whole_stream_command;
|
||||
use std::error::Error;
|
||||
|
||||
pub fn create_default_context(interactive: bool) -> Result<EvaluationContext, Box<dyn Error>> {
|
||||
let context = crate::cli::basic_evaluation_context()?;
|
||||
let context = basic_evaluation_context()?;
|
||||
|
||||
{
|
||||
use crate::commands::*;
|
||||
|
Reference in New Issue
Block a user