Fixed upgrading keys on the first run
This commit is contained in:
parent
14a9942d14
commit
ddb242c969
@ -1 +1 @@
|
|||||||
Subproject commit e8f4624b7f1a15c63674eecf577c7ab76c3b16be
|
Subproject commit 9028c4801fd39fbb71a9796979182549a24e81c8
|
@ -139,9 +139,7 @@ fn file_exists(path: &Path) -> bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn upgrade_key_location(from: &PathBuf, to: &PathBuf) {
|
pub fn upgrade_key_location(from: &PathBuf, to: &PathBuf) {
|
||||||
let mut parent = to.clone();
|
match fs::create_dir_all(&to).and_then(|()| fs::read_dir(from)) {
|
||||||
parent.pop();
|
|
||||||
match fs::create_dir_all(&parent).and_then(|()| fs::read_dir(from)) {
|
|
||||||
Ok(entries) => {
|
Ok(entries) => {
|
||||||
let files: Vec<_> = entries.filter_map(|f| f.ok().and_then(|f| if f.file_type().ok().map_or(false, |f| f.is_file()) { f.file_name().to_str().map(|s| s.to_owned()) } else { None })).collect();
|
let files: Vec<_> = entries.filter_map(|f| f.ok().and_then(|f| if f.file_type().ok().map_or(false, |f| f.is_file()) { f.file_name().to_str().map(|s| s.to_owned()) } else { None })).collect();
|
||||||
let mut num: usize = 0;
|
let mut num: usize = 0;
|
||||||
@ -165,7 +163,7 @@ pub fn upgrade_key_location(from: &PathBuf, to: &PathBuf) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
warn!("Error moving keys from {:?} to {:?}: {:?}", from, to, e);
|
debug!("Error moving keys from {:?} to {:?}: {:?}", from, to, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user