mirror of
https://github.com/nushell/nushell.git
synced 2025-05-04 10:04:27 +02:00
parent
29fd8b55fb
commit
65980c7beb
@ -296,23 +296,26 @@ async fn run_with_stdin(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let errored = match popen.wait() {
|
loop {
|
||||||
Ok(status) => !status.success(),
|
match popen.poll() {
|
||||||
Err(e) => true,
|
None => std::thread::sleep(std::time::Duration::new(0, 100_000_000)),
|
||||||
};
|
Some(status) => {
|
||||||
|
if !status.success() {
|
||||||
if errored {
|
yield Ok(Value {
|
||||||
yield Ok(Value {
|
value: UntaggedValue::Error(
|
||||||
value: UntaggedValue::Error(
|
ShellError::labeled_error(
|
||||||
ShellError::labeled_error(
|
"External command failed",
|
||||||
"External command failed",
|
"command failed",
|
||||||
"command failed",
|
&name_tag,
|
||||||
&name_tag,
|
)
|
||||||
)
|
),
|
||||||
),
|
tag: name_tag,
|
||||||
tag: name_tag,
|
});
|
||||||
});
|
}
|
||||||
};
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(Some(stream.to_input_stream()))
|
Ok(Some(stream.to_input_stream()))
|
||||||
|
Loading…
Reference in New Issue
Block a user