Check for file existence before attempting to open it (#626)
* Check for file existence before attempting to open it * Fixup
This commit is contained in:
parent
dd36129aa2
commit
b3dcf07f58
|
@ -266,6 +266,10 @@ impl Action for CreateFile {
|
|||
buf: _,
|
||||
force: _,
|
||||
} = self;
|
||||
// The user already deleted it
|
||||
if !path.exists() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
remove_file(&path)
|
||||
.await
|
||||
|
|
|
@ -339,6 +339,11 @@ impl Action for CreateOrInsertIntoFile {
|
|||
buf,
|
||||
position: _,
|
||||
} = self;
|
||||
// The user already deleted it
|
||||
if !path.exists() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let mut file = OpenOptions::new()
|
||||
.create(false)
|
||||
.write(true)
|
||||
|
|
|
@ -104,8 +104,8 @@ impl Planner for Linux {
|
|||
let Self { settings, init } = self;
|
||||
let mut map = HashMap::default();
|
||||
|
||||
map.extend(settings.settings()?.into_iter());
|
||||
map.extend(init.settings()?.into_iter());
|
||||
map.extend(settings.settings()?);
|
||||
map.extend(init.settings()?);
|
||||
|
||||
Ok(map)
|
||||
}
|
||||
|
|
|
@ -234,7 +234,7 @@ impl Planner for Ostree {
|
|||
} = self;
|
||||
let mut map = HashMap::default();
|
||||
|
||||
map.extend(settings.settings()?.into_iter());
|
||||
map.extend(settings.settings()?);
|
||||
map.insert(
|
||||
"persistence".to_string(),
|
||||
serde_json::to_value(persistence)?,
|
||||
|
|
|
@ -360,7 +360,7 @@ impl Planner for SteamDeck {
|
|||
} = self;
|
||||
let mut map = HashMap::default();
|
||||
|
||||
map.extend(settings.settings()?.into_iter());
|
||||
map.extend(settings.settings()?);
|
||||
map.insert(
|
||||
"persistence".to_string(),
|
||||
serde_json::to_value(persistence)?,
|
||||
|
|
Loading…
Reference in a new issue