mirror of
https://github.com/rustic-rs/rustic.git
synced 2025-10-26 11:18:51 +00:00
fix backup source handling in case sanitizing fails
Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com>
This commit is contained in:
parent
f565eea1f6
commit
84c2cb6c1f
@ -208,7 +208,10 @@ impl BackupCmd {
|
||||
})
|
||||
.collect();
|
||||
|
||||
let snapshot_sources = match (self.cli_sources.is_empty(), snapshot_opts.is_empty()) {
|
||||
let snapshot_sources = match (
|
||||
self.cli_sources.is_empty(),
|
||||
config_snapshot_sources.is_empty(),
|
||||
) {
|
||||
(false, _) => {
|
||||
let item = PathList::from_iter(&self.cli_sources).sanitize()?;
|
||||
vec![item]
|
||||
@ -218,12 +221,9 @@ impl BackupCmd {
|
||||
config_snapshot_sources.clone()
|
||||
}
|
||||
(true, true) => {
|
||||
bail!("no backup source given.");
|
||||
bail!("No usable backup source. Please make sure that the given sources are valid.");
|
||||
}
|
||||
};
|
||||
if snapshot_sources.is_empty() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let mut is_err = false;
|
||||
for sources in snapshot_sources {
|
||||
@ -239,6 +239,7 @@ impl BackupCmd {
|
||||
is_err = true;
|
||||
}
|
||||
}
|
||||
|
||||
if is_err {
|
||||
Err(anyhow!("Not all snapshots were generated successfully!"))
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user