mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
0120e4040d | |||
716c144e24 |
48
Cargo.lock
generated
48
Cargo.lock
generated
@ -2649,7 +2649,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"assert_cmd",
|
||||
"atty",
|
||||
@ -2704,7 +2704,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-cli"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"atty",
|
||||
"chrono",
|
||||
@ -2733,7 +2733,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-cmd-lang"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"fancy-regex",
|
||||
"itertools",
|
||||
@ -2750,7 +2750,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-color-config"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"nu-ansi-term",
|
||||
"nu-engine",
|
||||
@ -2764,7 +2764,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-command"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"Inflector",
|
||||
"alphanumeric-sort",
|
||||
@ -2868,7 +2868,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-engine"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"nu-glob",
|
||||
@ -2881,7 +2881,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-explore"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"ansi-str 0.7.2",
|
||||
"crossterm 0.24.0",
|
||||
@ -2901,14 +2901,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-glob"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"doc-comment",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nu-json"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"linked-hash-map",
|
||||
"num-traits",
|
||||
@ -2917,7 +2917,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-parser"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"bytesize",
|
||||
"chrono",
|
||||
@ -2934,7 +2934,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-path"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"dirs-next",
|
||||
"omnipath",
|
||||
@ -2943,7 +2943,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-plugin"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"nu-engine",
|
||||
@ -2956,7 +2956,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-pretty-hex"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"heapless",
|
||||
"nu-ansi-term",
|
||||
@ -2965,7 +2965,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-protocol"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"byte-unit",
|
||||
"chrono",
|
||||
@ -2988,7 +2988,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-system"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"atty",
|
||||
"chrono",
|
||||
@ -3006,7 +3006,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-table"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"atty",
|
||||
"json_to_table",
|
||||
@ -3021,7 +3021,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-term-grid"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"nu-utils",
|
||||
"unicode-width",
|
||||
@ -3029,7 +3029,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-test-support"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"getset",
|
||||
"hamcrest2",
|
||||
@ -3044,7 +3044,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-utils"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"crossterm_winapi",
|
||||
"log",
|
||||
@ -3066,7 +3066,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu_plugin_example"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"nu-plugin",
|
||||
"nu-protocol",
|
||||
@ -3074,7 +3074,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu_plugin_formats"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"eml-parser",
|
||||
"ical",
|
||||
@ -3087,7 +3087,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu_plugin_gstat"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"git2",
|
||||
"nu-engine",
|
||||
@ -3097,7 +3097,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu_plugin_inc"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"nu-plugin",
|
||||
"nu-protocol",
|
||||
@ -3106,7 +3106,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu_plugin_query"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
dependencies = [
|
||||
"gjson",
|
||||
"nu-engine",
|
||||
|
34
Cargo.toml
34
Cargo.toml
@ -10,7 +10,7 @@ license = "MIT"
|
||||
name = "nu"
|
||||
repository = "https://github.com/nushell/nushell"
|
||||
rust-version = "1.60"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@ -46,21 +46,21 @@ crossterm = "0.24.0"
|
||||
ctrlc = "3.2.1"
|
||||
log = "0.4"
|
||||
miette = { version = "5.5.0", features = ["fancy-no-backtrace"] }
|
||||
nu-cli = { path = "./crates/nu-cli", version = "0.77.0" }
|
||||
nu-color-config = { path = "./crates/nu-color-config", version = "0.77.0" }
|
||||
nu-cmd-lang = { path = "./crates/nu-cmd-lang", version = "0.77.0" }
|
||||
nu-command = { path = "./crates/nu-command", version = "0.77.0" }
|
||||
nu-engine = { path = "./crates/nu-engine", version = "0.77.0" }
|
||||
nu-json = { path = "./crates/nu-json", version = "0.77.0" }
|
||||
nu-parser = { path = "./crates/nu-parser", version = "0.77.0" }
|
||||
nu-path = { path = "./crates/nu-path", version = "0.77.0" }
|
||||
nu-plugin = { path = "./crates/nu-plugin", optional = true, version = "0.77.0" }
|
||||
nu-pretty-hex = { path = "./crates/nu-pretty-hex", version = "0.77.0" }
|
||||
nu-protocol = { path = "./crates/nu-protocol", version = "0.77.0" }
|
||||
nu-system = { path = "./crates/nu-system", version = "0.77.0" }
|
||||
nu-table = { path = "./crates/nu-table", version = "0.77.0" }
|
||||
nu-term-grid = { path = "./crates/nu-term-grid", version = "0.77.0" }
|
||||
nu-utils = { path = "./crates/nu-utils", version = "0.77.0" }
|
||||
nu-cli = { path = "./crates/nu-cli", version = "0.77.1" }
|
||||
nu-color-config = { path = "./crates/nu-color-config", version = "0.77.1" }
|
||||
nu-cmd-lang = { path = "./crates/nu-cmd-lang", version = "0.77.1" }
|
||||
nu-command = { path = "./crates/nu-command", version = "0.77.1" }
|
||||
nu-engine = { path = "./crates/nu-engine", version = "0.77.1" }
|
||||
nu-json = { path = "./crates/nu-json", version = "0.77.1" }
|
||||
nu-parser = { path = "./crates/nu-parser", version = "0.77.1" }
|
||||
nu-path = { path = "./crates/nu-path", version = "0.77.1" }
|
||||
nu-plugin = { path = "./crates/nu-plugin", optional = true, version = "0.77.1" }
|
||||
nu-pretty-hex = { path = "./crates/nu-pretty-hex", version = "0.77.1" }
|
||||
nu-protocol = { path = "./crates/nu-protocol", version = "0.77.1" }
|
||||
nu-system = { path = "./crates/nu-system", version = "0.77.1" }
|
||||
nu-table = { path = "./crates/nu-table", version = "0.77.1" }
|
||||
nu-term-grid = { path = "./crates/nu-term-grid", version = "0.77.1" }
|
||||
nu-utils = { path = "./crates/nu-utils", version = "0.77.1" }
|
||||
|
||||
nu-ansi-term = "0.47.0"
|
||||
reedline = { version = "0.17.0", features = ["bashisms", "sqlite"] }
|
||||
@ -89,7 +89,7 @@ nix = { version = "0.26", default-features = false, features = [
|
||||
atty = "0.2"
|
||||
|
||||
[dev-dependencies]
|
||||
nu-test-support = { path = "./crates/nu-test-support", version = "0.77.0" }
|
||||
nu-test-support = { path = "./crates/nu-test-support", version = "0.77.1" }
|
||||
tempfile = "3.4.0"
|
||||
assert_cmd = "2.0.2"
|
||||
criterion = "0.4"
|
||||
|
@ -5,23 +5,23 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-cli"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-cli"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
|
||||
[dev-dependencies]
|
||||
nu-test-support = { path = "../nu-test-support", version = "0.77.0" }
|
||||
nu-command = { path = "../nu-command", version = "0.77.0" }
|
||||
nu-test-support = { path = "../nu-test-support", version = "0.77.1" }
|
||||
nu-command = { path = "../nu-command", version = "0.77.1" }
|
||||
rstest = { version = "0.16.0", default-features = false }
|
||||
|
||||
[dependencies]
|
||||
nu-engine = { path = "../nu-engine", version = "0.77.0" }
|
||||
nu-path = { path = "../nu-path", version = "0.77.0" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.77.0" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.77.0" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.77.0" }
|
||||
nu-color-config = { path = "../nu-color-config", version = "0.77.0" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.77.1" }
|
||||
nu-path = { path = "../nu-path", version = "0.77.1" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.77.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.77.1" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.77.1" }
|
||||
nu-color-config = { path = "../nu-color-config", version = "0.77.1" }
|
||||
|
||||
nu-ansi-term = "0.47.0"
|
||||
reedline = { version = "0.17.0", features = ["bashisms", "sqlite"] }
|
||||
|
@ -6,17 +6,17 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-cmd-lang"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-cmd-lang"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
|
||||
[dependencies]
|
||||
nu-color-config = { path = "../nu-color-config", version = "0.77.0" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.77.0" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.77.0" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.77.0" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.77.0" }
|
||||
nu-color-config = { path = "../nu-color-config", version = "0.77.1" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.77.1" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.77.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.77.1" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.77.1" }
|
||||
|
||||
nu-ansi-term = "0.47.0"
|
||||
|
||||
@ -29,4 +29,4 @@ shadow-rs = { version = "0.21.0", default-features = false }
|
||||
shadow-rs = { version = "0.21.0", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
nu-test-support = { path="../nu-test-support", version = "0.77.0" }
|
||||
nu-test-support = { path="../nu-test-support", version = "0.77.1" }
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-color-confi
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-color-config"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
@ -15,11 +15,11 @@ serde = { version="1.0.123", features=["derive"] }
|
||||
# used only for text_style Alignments
|
||||
tabled = { version = "0.10.0", features = ["color"], default-features = false }
|
||||
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.77.0" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.77.1" }
|
||||
nu-ansi-term = "0.47.0"
|
||||
nu-utils = { path = "../nu-utils", version = "0.77.0" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.77.0" }
|
||||
nu-json = { path="../nu-json", version = "0.77.0" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.77.1" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.77.1" }
|
||||
nu-json = { path="../nu-json", version = "0.77.1" }
|
||||
|
||||
[dev-dependencies]
|
||||
nu-test-support = { path="../nu-test-support", version = "0.77.0" }
|
||||
nu-test-support = { path="../nu-test-support", version = "0.77.1" }
|
||||
|
@ -5,7 +5,7 @@ edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-command"
|
||||
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-command"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@ -13,20 +13,20 @@ version = "0.77.0"
|
||||
bench = false
|
||||
|
||||
[dependencies]
|
||||
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.77.0" }
|
||||
nu-color-config = { path = "../nu-color-config", version = "0.77.0" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.77.0" }
|
||||
nu-explore = { path = "../nu-explore", version = "0.77.0" }
|
||||
nu-glob = { path = "../nu-glob", version = "0.77.0" }
|
||||
nu-json = { path = "../nu-json", version = "0.77.0" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.77.0" }
|
||||
nu-path = { path = "../nu-path", version = "0.77.0" }
|
||||
nu-pretty-hex = { path = "../nu-pretty-hex", version = "0.77.0" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.77.0" }
|
||||
nu-system = { path = "../nu-system", version = "0.77.0" }
|
||||
nu-table = { path = "../nu-table", version = "0.77.0" }
|
||||
nu-term-grid = { path = "../nu-term-grid", version = "0.77.0" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.77.0" }
|
||||
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.77.1" }
|
||||
nu-color-config = { path = "../nu-color-config", version = "0.77.1" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.77.1" }
|
||||
nu-explore = { path = "../nu-explore", version = "0.77.1" }
|
||||
nu-glob = { path = "../nu-glob", version = "0.77.1" }
|
||||
nu-json = { path = "../nu-json", version = "0.77.1" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.77.1" }
|
||||
nu-path = { path = "../nu-path", version = "0.77.1" }
|
||||
nu-pretty-hex = { path = "../nu-pretty-hex", version = "0.77.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.77.1" }
|
||||
nu-system = { path = "../nu-system", version = "0.77.1" }
|
||||
nu-table = { path = "../nu-table", version = "0.77.1" }
|
||||
nu-term-grid = { path = "../nu-term-grid", version = "0.77.1" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.77.1" }
|
||||
num-format = { version = "0.4.3" }
|
||||
|
||||
nu-ansi-term = "0.47.0"
|
||||
@ -156,7 +156,7 @@ trash-support = ["trash"]
|
||||
which-support = ["which"]
|
||||
|
||||
[dev-dependencies]
|
||||
nu-test-support = { path = "../nu-test-support", version = "0.77.0" }
|
||||
nu-test-support = { path = "../nu-test-support", version = "0.77.1" }
|
||||
mockito = "0.32.3"
|
||||
|
||||
dirs-next = "2.0.0"
|
||||
|
@ -139,17 +139,6 @@ fn failed_command_with_semicolon_will_not_execute_following_cmds() {
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn semicolon_works_within_subcommand() {
|
||||
Playground::setup("external failed command with semicolon", |dirs, _| {
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(), pipeline(r#"(nu --testbin outcome_err "aa"; echo done)"#
|
||||
));
|
||||
|
||||
assert!(!actual.out.contains("done"));
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
#[test]
|
||||
fn external_args_with_quoted() {
|
||||
|
@ -5,16 +5,16 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-engine"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-engine"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
|
||||
[dependencies]
|
||||
nu-protocol = { path = "../nu-protocol", features = ["plugin"], version = "0.77.0" }
|
||||
nu-path = { path = "../nu-path", version = "0.77.0" }
|
||||
nu-glob = { path = "../nu-glob", version = "0.77.0" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.77.0" }
|
||||
nu-protocol = { path = "../nu-protocol", features = ["plugin"], version = "0.77.1" }
|
||||
nu-path = { path = "../nu-path", version = "0.77.1" }
|
||||
nu-glob = { path = "../nu-glob", version = "0.77.1" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.77.1" }
|
||||
|
||||
chrono = { version="0.4.23", features = ["std"], default-features = false }
|
||||
serde = {version = "1.0.143", default-features = false }
|
||||
|
@ -705,14 +705,7 @@ pub fn eval_expression_with_input(
|
||||
}
|
||||
};
|
||||
|
||||
// Note: for `table` command, it mights returns `ExternalStream with stdout`
|
||||
// whatever `redirect_output` is true or false, so we only want to consume ExternalStream
|
||||
// if relative stdout is None.
|
||||
if let PipelineData::ExternalStream { stdout: None, .. } = input {
|
||||
Ok(might_consume_external_result(input))
|
||||
} else {
|
||||
Ok((input, false))
|
||||
}
|
||||
Ok(might_consume_external_result(input))
|
||||
}
|
||||
|
||||
// Try to catch and detect if external command runs to failed.
|
||||
@ -1217,72 +1210,14 @@ pub fn eval_subexpression(
|
||||
mut input: PipelineData,
|
||||
) -> Result<PipelineData, ShellError> {
|
||||
for pipeline in block.pipelines.iter() {
|
||||
for (expr_indx, expr) in pipeline.elements.iter().enumerate() {
|
||||
if expr_indx != pipeline.elements.len() - 1 {
|
||||
input = eval_element_with_input(engine_state, stack, expr, input, true, false)?.0;
|
||||
} else {
|
||||
// In subexpression, we always need to redirect stdout because the result is substituted to a Value.
|
||||
//
|
||||
// But we can check if external result is failed to run when it's the last expression
|
||||
// in pipeline. e.g: (^false; echo aaa)
|
||||
//
|
||||
// If external command is failed to run, it can't be convert into value, in this case
|
||||
// we throws out `ShellError::ExternalCommand`. And show it's stderr message information.
|
||||
// In the case, we need to capture stderr first during eval.
|
||||
input = eval_element_with_input(engine_state, stack, expr, input, true, true)?.0;
|
||||
if matches!(input, PipelineData::ExternalStream { .. }) {
|
||||
input = check_subexp_substitution(input)?;
|
||||
}
|
||||
}
|
||||
for expr in pipeline.elements.iter() {
|
||||
input = eval_element_with_input(engine_state, stack, expr, input, true, false)?.0
|
||||
}
|
||||
}
|
||||
|
||||
Ok(input)
|
||||
}
|
||||
|
||||
fn check_subexp_substitution(mut input: PipelineData) -> Result<PipelineData, ShellError> {
|
||||
let consume_result = might_consume_external_result(input);
|
||||
input = consume_result.0;
|
||||
let failed_to_run = consume_result.1;
|
||||
if let PipelineData::ExternalStream {
|
||||
stdout,
|
||||
stderr,
|
||||
exit_code,
|
||||
span,
|
||||
metadata,
|
||||
trim_end_newline,
|
||||
} = input
|
||||
{
|
||||
let stderr_msg = match stderr {
|
||||
None => "".to_string(),
|
||||
Some(stderr_stream) => stderr_stream.into_string().map(|s| s.item)?,
|
||||
};
|
||||
if failed_to_run {
|
||||
Err(ShellError::ExternalCommand {
|
||||
label: "External command failed".to_string(),
|
||||
help: stderr_msg,
|
||||
span,
|
||||
})
|
||||
} else {
|
||||
// we've captured stderr message, but it's running success.
|
||||
// So we need to re-print stderr message out.
|
||||
if !stderr_msg.is_empty() {
|
||||
eprintln!("{stderr_msg}");
|
||||
}
|
||||
Ok(PipelineData::ExternalStream {
|
||||
stdout,
|
||||
stderr: None,
|
||||
exit_code,
|
||||
span,
|
||||
metadata,
|
||||
trim_end_newline,
|
||||
})
|
||||
}
|
||||
} else {
|
||||
Ok(input)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn eval_variable(
|
||||
engine_state: &EngineState,
|
||||
stack: &Stack,
|
||||
|
@ -5,20 +5,20 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-explore"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-explore"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
|
||||
[dependencies]
|
||||
nu-ansi-term = "0.47.0"
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.77.0" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.77.0" }
|
||||
nu-color-config = { path = "../nu-color-config", version = "0.77.0" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.77.0" }
|
||||
nu-table = { path = "../nu-table", version = "0.77.0" }
|
||||
nu-json = { path = "../nu-json", version = "0.77.0" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.77.0" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.77.1" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.77.1" }
|
||||
nu-color-config = { path = "../nu-color-config", version = "0.77.1" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.77.1" }
|
||||
nu-table = { path = "../nu-table", version = "0.77.1" }
|
||||
nu-json = { path = "../nu-json", version = "0.77.1" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.77.1" }
|
||||
|
||||
terminal_size = "0.2.1"
|
||||
strip-ansi-escapes = "0.1.1"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nu-glob"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
authors = ["The Nushell Project Developers", "The Rust Project Developers"]
|
||||
license = "MIT/Apache-2.0"
|
||||
description = """
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-json"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-json"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@ -22,5 +22,5 @@ num-traits = "0.2.14"
|
||||
serde = "1.0"
|
||||
|
||||
[dev-dependencies]
|
||||
# nu-path = { path="../nu-path", version = "0.77.0" }
|
||||
# nu-path = { path="../nu-path", version = "0.77.1" }
|
||||
# serde_json = "1.0"
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-parser"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-parser"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
@ -17,10 +17,10 @@ itertools = "0.10"
|
||||
miette = {version = "5.5.0", features = ["fancy-no-backtrace"]}
|
||||
thiserror = "1.0.31"
|
||||
serde_json = "1.0"
|
||||
nu-path = {path = "../nu-path", version = "0.77.0" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.77.0" }
|
||||
nu-plugin = { path = "../nu-plugin", optional = true, version = "0.77.0" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.77.0" }
|
||||
nu-path = {path = "../nu-path", version = "0.77.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.77.1" }
|
||||
nu-plugin = { path = "../nu-plugin", optional = true, version = "0.77.1" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.77.1" }
|
||||
log = "0.4"
|
||||
|
||||
[features]
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-path"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-path"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
|
@ -5,15 +5,15 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-plugin"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-plugin"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
|
||||
[dependencies]
|
||||
bincode = "1.3.3"
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.77.0" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.77.0" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.77.1" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.77.1" }
|
||||
serde = { version = "1.0.143" }
|
||||
serde_json = { version = "1.0"}
|
||||
rmp = "0.8.11"
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-pretty-hex"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-pretty-hex"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-protocol"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-protocol"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@ -13,7 +13,7 @@ version = "0.77.0"
|
||||
bench = false
|
||||
|
||||
[dependencies]
|
||||
nu-utils = { path = "../nu-utils", version = "0.77.0" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.77.1" }
|
||||
|
||||
byte-unit = "4.0.9"
|
||||
chrono = { version = "0.4.23", features = [
|
||||
@ -39,4 +39,4 @@ plugin = ["serde_json"]
|
||||
|
||||
[dev-dependencies]
|
||||
serde_json = "1.0"
|
||||
nu-test-support = { path = "../nu-test-support", version = "0.77.0" }
|
||||
nu-test-support = { path = "../nu-test-support", version = "0.77.1" }
|
||||
|
@ -538,7 +538,7 @@ impl PipelineData {
|
||||
// Only need ExternalStream without redirecting output.
|
||||
// It indicates we have no more commands to execute currently.
|
||||
if let PipelineData::ExternalStream {
|
||||
stdout,
|
||||
stdout: None,
|
||||
stderr,
|
||||
mut exit_code,
|
||||
span,
|
||||
@ -549,54 +549,22 @@ impl PipelineData {
|
||||
let exit_code = exit_code.take();
|
||||
|
||||
// Note:
|
||||
// use a thread to receive stderr message.
|
||||
// Or we may get a deadlock if child process sends out too much bytes to stdout.
|
||||
// In run-external's implementation detail, the result sender thread
|
||||
// send out stderr message first, then stdout message, then exit_code.
|
||||
//
|
||||
// For example: in normal linux system, stdout pipe's limit is 65535 bytes.
|
||||
// if child process sends out 65536 bytes, the process will be hanged because no consumer
|
||||
// consumes the first 65535 bytes
|
||||
// So we need a thread to receive stderr message, then the current thread can continue to consume
|
||||
// stdout messages.
|
||||
let stderr_handler = stderr.map(|stderr| {
|
||||
let stderr_span = stderr.span;
|
||||
let stderr_ctrlc = stderr.ctrlc.clone();
|
||||
(
|
||||
thread::Builder::new()
|
||||
.name("stderr consumer".to_string())
|
||||
.spawn(move || {
|
||||
stderr
|
||||
.into_bytes()
|
||||
.map(|bytes| bytes.item)
|
||||
.unwrap_or_default()
|
||||
})
|
||||
.expect("failed to create thread"),
|
||||
stderr_span,
|
||||
stderr_ctrlc,
|
||||
)
|
||||
});
|
||||
let stdout = stdout.map(|stdout_stream| {
|
||||
let stdout_ctrlc = stdout_stream.ctrlc.clone();
|
||||
let stdout_span = stdout_stream.span;
|
||||
let stdout_bytes = stdout_stream
|
||||
// In this clause, we already make sure that `stdout` is None
|
||||
// But not the case of `stderr`, so if `stderr` is not None
|
||||
// We need to consume stderr message before reading external commands' exit code.
|
||||
//
|
||||
// Or we'll never have a chance to read exit_code if stderr producer produce too much stderr message.
|
||||
// So we consume stderr stream and rebuild it.
|
||||
let stderr = stderr.map(|stderr_stream| {
|
||||
let stderr_ctrlc = stderr_stream.ctrlc.clone();
|
||||
let stderr_span = stderr_stream.span;
|
||||
let stderr_bytes = stderr_stream
|
||||
.into_bytes()
|
||||
.map(|bytes| bytes.item)
|
||||
.unwrap_or_default();
|
||||
RawStream::new(
|
||||
Box::new(vec![Ok(stdout_bytes)].into_iter()),
|
||||
stdout_ctrlc,
|
||||
stdout_span,
|
||||
None,
|
||||
)
|
||||
});
|
||||
let stderr = stderr_handler.map(|(handler, stderr_span, stderr_ctrlc)| {
|
||||
let stderr_bytes = handler
|
||||
.join()
|
||||
.map_err(|err| ShellError::ExternalCommand {
|
||||
label: "Fail to receive external commands stderr message".to_string(),
|
||||
help: format!("{err:?}"),
|
||||
span: stderr_span,
|
||||
})
|
||||
.unwrap_or_default();
|
||||
RawStream::new(
|
||||
Box::new(vec![Ok(stderr_bytes)].into_iter()),
|
||||
stderr_ctrlc,
|
||||
@ -604,6 +572,7 @@ impl PipelineData {
|
||||
None,
|
||||
)
|
||||
});
|
||||
|
||||
match exit_code {
|
||||
Some(exit_code_stream) => {
|
||||
let ctrlc = exit_code_stream.ctrlc.clone();
|
||||
@ -616,7 +585,7 @@ impl PipelineData {
|
||||
}
|
||||
(
|
||||
PipelineData::ExternalStream {
|
||||
stdout,
|
||||
stdout: None,
|
||||
stderr,
|
||||
exit_code: Some(ListStream::from_stream(exit_code.into_iter(), ctrlc)),
|
||||
span,
|
||||
@ -628,7 +597,7 @@ impl PipelineData {
|
||||
}
|
||||
None => (
|
||||
PipelineData::ExternalStream {
|
||||
stdout,
|
||||
stdout: None,
|
||||
stderr,
|
||||
exit_code: None,
|
||||
span,
|
||||
|
@ -3,7 +3,7 @@ authors = ["The Nushell Project Developers", "procs creators"]
|
||||
description = "Nushell system querying"
|
||||
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-system"
|
||||
name = "nu-system"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
|
||||
|
@ -5,16 +5,16 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-table"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-table"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
|
||||
[dependencies]
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.77.0" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.77.0" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.77.0" }
|
||||
nu-color-config = { path = "../nu-color-config", version = "0.77.0" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.77.1" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.77.1" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.77.1" }
|
||||
nu-color-config = { path = "../nu-color-config", version = "0.77.1" }
|
||||
|
||||
nu-ansi-term = "0.47.0"
|
||||
|
||||
@ -24,4 +24,4 @@ json_to_table = { version = "0.3.1", features = ["color"] }
|
||||
serde_json = "1"
|
||||
|
||||
[dev-dependencies]
|
||||
# nu-test-support = { path="../nu-test-support", version = "0.77.0" }
|
||||
# nu-test-support = { path="../nu-test-support", version = "0.77.1" }
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-term-grid"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-term-grid"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
@ -13,4 +13,4 @@ bench = false
|
||||
[dependencies]
|
||||
unicode-width = "0.1.9"
|
||||
|
||||
nu-utils = { path = "../nu-utils", version = "0.77.0" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.77.1" }
|
||||
|
@ -5,16 +5,16 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-test-suppor
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-test-support"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
bench = false
|
||||
|
||||
[dependencies]
|
||||
nu-path = { path="../nu-path", version = "0.77.0" }
|
||||
nu-glob = { path = "../nu-glob", version = "0.77.0" }
|
||||
nu-utils = { path="../nu-utils", version = "0.77.0" }
|
||||
nu-path = { path="../nu-path", version = "0.77.1" }
|
||||
nu-glob = { path = "../nu-glob", version = "0.77.1" }
|
||||
nu-utils = { path="../nu-utils", version = "0.77.1" }
|
||||
once_cell = "1.16.0"
|
||||
num-format = "0.4.3"
|
||||
which = "4.3.0"
|
||||
|
@ -5,7 +5,7 @@ edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-utils"
|
||||
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-utils"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
[[bin]]
|
||||
|
@ -10,7 +10,7 @@ name = "nu_plugin_custom_values"
|
||||
bench = false
|
||||
|
||||
[dependencies]
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.77.0" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.77.0", features = ["plugin"] }
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.77.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.77.1", features = ["plugin"] }
|
||||
serde = { version = "1.0", default-features = false }
|
||||
typetag = "0.2.5"
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_exam
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_example"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
|
||||
[[bin]]
|
||||
name = "nu_plugin_example"
|
||||
@ -15,5 +15,5 @@ bench = false
|
||||
bench = false
|
||||
|
||||
[dependencies]
|
||||
nu-plugin = { path="../nu-plugin", version = "0.77.0" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.77.0", features = ["plugin"]}
|
||||
nu-plugin = { path="../nu-plugin", version = "0.77.1" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.77.1", features = ["plugin"]}
|
||||
|
@ -5,13 +5,13 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_form
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_formats"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.77.0" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.77.0", features = ["plugin"] }
|
||||
nu-engine = { path = "../nu-engine", version = "0.77.0" }
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.77.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.77.1", features = ["plugin"] }
|
||||
nu-engine = { path = "../nu-engine", version = "0.77.1" }
|
||||
indexmap = { version = "1.7", features = ["serde-1"] }
|
||||
|
||||
eml-parser = "0.1.0"
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_gsta
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_gstat"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
@ -16,8 +16,8 @@ name = "nu_plugin_gstat"
|
||||
bench = false
|
||||
|
||||
[dependencies]
|
||||
nu-plugin = { path="../nu-plugin", version = "0.77.0" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.77.0" }
|
||||
nu-engine = { path="../nu-engine", version = "0.77.0" }
|
||||
nu-plugin = { path="../nu-plugin", version = "0.77.1" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.77.1" }
|
||||
nu-engine = { path="../nu-engine", version = "0.77.1" }
|
||||
|
||||
git2 = "0.16.1"
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_inc"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_inc"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
@ -16,7 +16,7 @@ name = "nu_plugin_inc"
|
||||
bench = false
|
||||
|
||||
[dependencies]
|
||||
nu-plugin = { path="../nu-plugin", version = "0.77.0" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.77.0", features = ["plugin"]}
|
||||
nu-plugin = { path="../nu-plugin", version = "0.77.1" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.77.1", features = ["plugin"]}
|
||||
|
||||
semver = "1.0.16"
|
||||
|
@ -5,7 +5,7 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_quer
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_query"
|
||||
version = "0.77.0"
|
||||
version = "0.77.1"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
@ -17,9 +17,9 @@ bench = false
|
||||
|
||||
|
||||
[dependencies]
|
||||
nu-plugin = { path="../nu-plugin", version = "0.77.0" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.77.0" }
|
||||
nu-engine = { path="../nu-engine", version = "0.77.0" }
|
||||
nu-plugin = { path="../nu-plugin", version = "0.77.1" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.77.1" }
|
||||
nu-engine = { path="../nu-engine", version = "0.77.1" }
|
||||
gjson = "0.8.0"
|
||||
scraper = { default-features = false, version = "0.15.0" }
|
||||
sxd-document = "0.3.2"
|
||||
|
Reference in New Issue
Block a user