mirror of
https://github.com/nushell/nushell.git
synced 2025-01-27 16:48:44 +01:00
de99e35106
* WIP * Finish up EngineState refactor * Fix Windows calls * Fix Windows calls * Fix Windows calls
19 lines
417 B
Rust
19 lines
417 B
Rust
use nu_source::Text;
|
|
|
|
use crate::EvaluationContext;
|
|
|
|
pub fn maybe_print_errors(context: &EvaluationContext, source: Text) -> bool {
|
|
let errors = context.current_errors().clone();
|
|
let mut errors = errors.lock();
|
|
|
|
if errors.len() > 0 {
|
|
let error = errors[0].clone();
|
|
*errors = vec![];
|
|
|
|
context.host().lock().print_err(error, &source);
|
|
true
|
|
} else {
|
|
false
|
|
}
|
|
}
|