forked from lix-project/lix-installer
fsync after writing Nix config to attempt to fix the flaky preserves_comment test (#448)
This commit is contained in:
parent
1ae77d11ee
commit
965185dcab
|
@ -434,6 +434,10 @@ impl Action for CreateOrMergeNixConfig {
|
|||
e,
|
||||
))
|
||||
})?;
|
||||
temp_file
|
||||
.sync_all()
|
||||
.await
|
||||
.map_err(|e| Self::error(ActionErrorKind::Sync(temp_file_path.clone(), e)))?;
|
||||
tokio::fs::rename(&temp_file_path, &path)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
|
|
|
@ -443,6 +443,8 @@ pub enum ActionErrorKind {
|
|||
Open(std::path::PathBuf, #[source] std::io::Error),
|
||||
#[error("Write path `{0}`")]
|
||||
Write(std::path::PathBuf, #[source] std::io::Error),
|
||||
#[error("Sync path `{0}`")]
|
||||
Sync(std::path::PathBuf, #[source] std::io::Error),
|
||||
#[error("Seek path `{0}`")]
|
||||
Seek(std::path::PathBuf, #[source] std::io::Error),
|
||||
#[error("Flushing `{0}`")]
|
||||
|
|
|
@ -27,7 +27,7 @@ impl std::fmt::Display for Logger {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(clap::Args, Debug)]
|
||||
#[derive(clap::Args, Debug, Default)]
|
||||
pub struct Instrumentation {
|
||||
/// Enable debug logs, -vv for trace
|
||||
#[clap(short = 'v', env = "NIX_INSTALLER_VERBOSITY", long, action = clap::ArgAction::Count, global = true)]
|
||||
|
|
Loading…
Reference in a new issue