mirror of
https://github.com/nushell/nushell.git
synced 2025-08-17 21:01:09 +02:00
refactor all write_alls to ensure flushing (#5567)
This commit is contained in:
@ -1,23 +1,20 @@
|
||||
use super::{Command, EnvVars, Stack};
|
||||
use crate::Value;
|
||||
use crate::{
|
||||
ast::Block, AliasId, BlockId, Config, DeclId, Example, Module, ModuleId, OverlayId, ShellError,
|
||||
Signature, Span, Type, VarId, Variable,
|
||||
};
|
||||
use core::panic;
|
||||
use std::borrow::Borrow;
|
||||
use std::collections::HashSet;
|
||||
use std::path::Path;
|
||||
#[cfg(feature = "plugin")]
|
||||
use std::path::PathBuf;
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
sync::{atomic::AtomicBool, Arc},
|
||||
};
|
||||
|
||||
use crate::Value;
|
||||
|
||||
use std::borrow::Borrow;
|
||||
use std::collections::HashSet;
|
||||
use std::path::Path;
|
||||
|
||||
#[cfg(feature = "plugin")]
|
||||
use std::path::PathBuf;
|
||||
|
||||
static PWD_ENV: &str = "PWD";
|
||||
pub static DEFAULT_OVERLAY_NAME: &str = "zero";
|
||||
|
||||
@ -651,6 +648,17 @@ impl EngineState {
|
||||
.write_all(line.as_bytes())
|
||||
.map_err(|err| ShellError::PluginFailedToLoad(err.to_string()))
|
||||
})
|
||||
.and_then(|_| {
|
||||
plugin_file.flush().map_err(|err| {
|
||||
ShellError::GenericError(
|
||||
"Error flushing plugin file".to_string(),
|
||||
format! {"{}", err},
|
||||
None,
|
||||
None,
|
||||
Vec::new(),
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user