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: _,
|
buf: _,
|
||||||
force: _,
|
force: _,
|
||||||
} = self;
|
} = self;
|
||||||
|
// The user already deleted it
|
||||||
|
if !path.exists() {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
remove_file(&path)
|
remove_file(&path)
|
||||||
.await
|
.await
|
||||||
|
|
|
@ -339,6 +339,11 @@ impl Action for CreateOrInsertIntoFile {
|
||||||
buf,
|
buf,
|
||||||
position: _,
|
position: _,
|
||||||
} = self;
|
} = self;
|
||||||
|
// The user already deleted it
|
||||||
|
if !path.exists() {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
let mut file = OpenOptions::new()
|
let mut file = OpenOptions::new()
|
||||||
.create(false)
|
.create(false)
|
||||||
.write(true)
|
.write(true)
|
||||||
|
|
|
@ -104,8 +104,8 @@ impl Planner for Linux {
|
||||||
let Self { settings, init } = self;
|
let Self { settings, init } = self;
|
||||||
let mut map = HashMap::default();
|
let mut map = HashMap::default();
|
||||||
|
|
||||||
map.extend(settings.settings()?.into_iter());
|
map.extend(settings.settings()?);
|
||||||
map.extend(init.settings()?.into_iter());
|
map.extend(init.settings()?);
|
||||||
|
|
||||||
Ok(map)
|
Ok(map)
|
||||||
}
|
}
|
||||||
|
|
|
@ -234,7 +234,7 @@ impl Planner for Ostree {
|
||||||
} = self;
|
} = self;
|
||||||
let mut map = HashMap::default();
|
let mut map = HashMap::default();
|
||||||
|
|
||||||
map.extend(settings.settings()?.into_iter());
|
map.extend(settings.settings()?);
|
||||||
map.insert(
|
map.insert(
|
||||||
"persistence".to_string(),
|
"persistence".to_string(),
|
||||||
serde_json::to_value(persistence)?,
|
serde_json::to_value(persistence)?,
|
||||||
|
|
|
@ -360,7 +360,7 @@ impl Planner for SteamDeck {
|
||||||
} = self;
|
} = self;
|
||||||
let mut map = HashMap::default();
|
let mut map = HashMap::default();
|
||||||
|
|
||||||
map.extend(settings.settings()?.into_iter());
|
map.extend(settings.settings()?);
|
||||||
map.insert(
|
map.insert(
|
||||||
"persistence".to_string(),
|
"persistence".to_string(),
|
||||||
serde_json::to_value(persistence)?,
|
serde_json::to_value(persistence)?,
|
||||||
|
|
Loading…
Reference in a new issue