Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/commands/backup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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 {
Expand All @@ -239,6 +239,7 @@ impl BackupCmd {
is_err = true;
}
}

if is_err {
Err(anyhow!("Not all snapshots were generated successfully!"))
} else {
Expand Down
Loading