forked from extern/nushell
Move eval_hook
to nu-cmd-base
(#10146)
I moved hook to *nu_cmd_base* instead of *nu_cli* because it will enable other developers to continue to use hook even if they decide to write their on cli or NOT depend on nu-cli Then they will still have the hook functionality because they can include nu-cmd-base
This commit is contained in:
parent
7d3312e96e
commit
3f2c76df28
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -2647,7 +2647,9 @@ name = "nu-cmd-base"
|
|||||||
version = "0.84.1"
|
version = "0.84.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"indexmap 2.0.0",
|
"indexmap 2.0.0",
|
||||||
|
"miette",
|
||||||
"nu-engine",
|
"nu-engine",
|
||||||
|
"nu-parser",
|
||||||
"nu-path",
|
"nu-path",
|
||||||
"nu-protocol",
|
"nu-protocol",
|
||||||
]
|
]
|
||||||
|
@ -12,12 +12,12 @@ bench = false
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.84.1" }
|
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.84.1" }
|
||||||
|
nu-command = { path = "../nu-command", version = "0.84.1" }
|
||||||
nu-test-support = { path = "../nu-test-support", version = "0.84.1" }
|
nu-test-support = { path = "../nu-test-support", version = "0.84.1" }
|
||||||
rstest = { version = "0.18.1", default-features = false }
|
rstest = { version = "0.18.1", default-features = false }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nu-cmd-base = { path = "../nu-cmd-base", version = "0.84.1" }
|
nu-cmd-base = { path = "../nu-cmd-base", version = "0.84.1" }
|
||||||
nu-command = { path = "../nu-command", version = "0.84.1" }
|
|
||||||
nu-engine = { path = "../nu-engine", version = "0.84.1" }
|
nu-engine = { path = "../nu-engine", version = "0.84.1" }
|
||||||
nu-path = { path = "../nu-path", version = "0.84.1" }
|
nu-path = { path = "../nu-path", version = "0.84.1" }
|
||||||
nu-parser = { path = "../nu-parser", version = "0.84.1" }
|
nu-parser = { path = "../nu-parser", version = "0.84.1" }
|
||||||
|
@ -8,9 +8,9 @@ use crate::{
|
|||||||
use crossterm::cursor::SetCursorStyle;
|
use crossterm::cursor::SetCursorStyle;
|
||||||
use log::{trace, warn};
|
use log::{trace, warn};
|
||||||
use miette::{ErrReport, IntoDiagnostic, Result};
|
use miette::{ErrReport, IntoDiagnostic, Result};
|
||||||
|
use nu_cmd_base::hook::eval_hook;
|
||||||
use nu_cmd_base::util::get_guaranteed_cwd;
|
use nu_cmd_base::util::get_guaranteed_cwd;
|
||||||
use nu_color_config::StyleComputer;
|
use nu_color_config::StyleComputer;
|
||||||
use nu_command::hook::eval_hook;
|
|
||||||
use nu_engine::convert_env_values;
|
use nu_engine::convert_env_values;
|
||||||
use nu_parser::{lex, parse, trim_quotes_str};
|
use nu_parser::{lex, parse, trim_quotes_str};
|
||||||
use nu_protocol::{
|
use nu_protocol::{
|
||||||
@ -50,7 +50,7 @@ pub fn evaluate_repl(
|
|||||||
load_std_lib: Option<Spanned<String>>,
|
load_std_lib: Option<Spanned<String>>,
|
||||||
entire_start_time: Instant,
|
entire_start_time: Instant,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
use nu_command::hook;
|
use nu_cmd_base::hook;
|
||||||
use reedline::Signal;
|
use reedline::Signal;
|
||||||
let use_color = engine_state.get_config().use_ansi_coloring;
|
let use_color = engine_state.get_config().use_ansi_coloring;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use nu_command::hook::eval_hook;
|
use nu_cmd_base::hook::eval_hook;
|
||||||
use nu_engine::{eval_block, eval_block_with_early_return};
|
use nu_engine::{eval_block, eval_block_with_early_return};
|
||||||
use nu_parser::{escape_quote_string, lex, parse, unescape_unquote_string, Token, TokenContents};
|
use nu_parser::{escape_quote_string, lex, parse, unescape_unquote_string, Token, TokenContents};
|
||||||
use nu_protocol::engine::StateWorkingSet;
|
use nu_protocol::engine::StateWorkingSet;
|
||||||
|
@ -11,6 +11,8 @@ version = "0.84.1"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nu-engine = { path = "../nu-engine", version = "0.84.1" }
|
nu-engine = { path = "../nu-engine", version = "0.84.1" }
|
||||||
|
nu-parser = { path = "../nu-parser", version = "0.84.1" }
|
||||||
nu-path = { path = "../nu-path", version = "0.84.1" }
|
nu-path = { path = "../nu-path", version = "0.84.1" }
|
||||||
nu-protocol = { version = "0.84.1", path = "../nu-protocol" }
|
nu-protocol = { version = "0.84.1", path = "../nu-protocol" }
|
||||||
indexmap = { version = "2.0" }
|
indexmap = { version = "2.0" }
|
||||||
|
miette = { version = "5.10", features = ["fancy-no-backtrace"] }
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
use crate::util::get_guaranteed_cwd;
|
||||||
use miette::Result;
|
use miette::Result;
|
||||||
use nu_cmd_base::util::get_guaranteed_cwd;
|
|
||||||
use nu_engine::{eval_block, eval_block_with_early_return};
|
use nu_engine::{eval_block, eval_block_with_early_return};
|
||||||
use nu_parser::parse;
|
use nu_parser::parse;
|
||||||
use nu_protocol::ast::PathMember;
|
use nu_protocol::ast::PathMember;
|
@ -1,3 +1,4 @@
|
|||||||
pub mod formats;
|
pub mod formats;
|
||||||
|
pub mod hook;
|
||||||
pub mod input_handler;
|
pub mod input_handler;
|
||||||
pub mod util;
|
pub mod util;
|
||||||
|
@ -13,7 +13,6 @@ mod formats;
|
|||||||
mod generators;
|
mod generators;
|
||||||
mod hash;
|
mod hash;
|
||||||
mod help;
|
mod help;
|
||||||
pub mod hook;
|
|
||||||
mod math;
|
mod math;
|
||||||
mod misc;
|
mod misc;
|
||||||
mod network;
|
mod network;
|
||||||
@ -44,7 +43,6 @@ pub use formats::*;
|
|||||||
pub use generators::*;
|
pub use generators::*;
|
||||||
pub use hash::*;
|
pub use hash::*;
|
||||||
pub use help::*;
|
pub use help::*;
|
||||||
pub use hook::*;
|
|
||||||
pub use math::*;
|
pub use math::*;
|
||||||
pub use misc::*;
|
pub use misc::*;
|
||||||
pub use network::*;
|
pub use network::*;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::hook::eval_hook;
|
use nu_cmd_base::hook::eval_hook;
|
||||||
use nu_engine::env_to_strings;
|
use nu_engine::env_to_strings;
|
||||||
use nu_engine::CallExt;
|
use nu_engine::CallExt;
|
||||||
use nu_protocol::{
|
use nu_protocol::{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use nu_command::hook::{eval_env_change_hook, eval_hook};
|
use nu_cmd_base::hook::{eval_env_change_hook, eval_hook};
|
||||||
use nu_engine::eval_block;
|
use nu_engine::eval_block;
|
||||||
use nu_parser::parse;
|
use nu_parser::parse;
|
||||||
use nu_protocol::engine::{EngineState, Stack, StateWorkingSet};
|
use nu_protocol::engine::{EngineState, Stack, StateWorkingSet};
|
||||||
|
Loading…
Reference in New Issue
Block a user