mirror of https://github.com/dswd/zvault
Backup files must end with .backup
This commit is contained in:
parent
259b12e35f
commit
0354a73f54
|
@ -168,7 +168,10 @@ impl Backup {
|
||||||
paths.push(path);
|
paths.push(path);
|
||||||
} else {
|
} else {
|
||||||
let relpath = path.strip_prefix(&base_path).unwrap();
|
let relpath = path.strip_prefix(&base_path).unwrap();
|
||||||
let name = relpath.to_string_lossy().to_string();
|
if relpath.extension() != Some(".backup".as_ref()) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
let name = relpath.file_stem().unwrap().to_string_lossy().to_string();
|
||||||
if let Ok(backup) = Backup::read_from(crypto, &path) {
|
if let Ok(backup) = Backup::read_from(crypto, &path) {
|
||||||
backups.insert(name, backup);
|
backups.insert(name, backup);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -52,7 +52,7 @@ impl RepositoryLayout {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn backup_path(&self, name: &str) -> PathBuf {
|
pub fn backup_path(&self, name: &str) -> PathBuf {
|
||||||
self.backups_path().join(name)
|
self.backups_path().join(format!("{}.backup", name))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
Loading…
Reference in New Issue