Rename and recreate the default Anime config if cache setup fails

This commit is contained in:
Luke D. Jones
2024-05-17 21:54:37 +12:00
parent 770bd12a5c
commit 1353fe3fdb
6 changed files with 32 additions and 12 deletions

View File

@@ -146,11 +146,7 @@ where
/// Renames the existing file to `<file>-old`
fn rename_file_old(&self) {
warn!(
"Renaming {} to {}-old and recreating config",
self.file_name(),
self.file_name()
);
warn!("Renaming {} to {}-old", self.file_name(), self.file_name());
let mut cfg_old = self.file_path().to_string_lossy().to_string();
cfg_old.push_str("-old");
std::fs::rename(self.file_path(), cfg_old).unwrap_or_else(|err| {