remove config migration code

This commit is contained in:
Stephan Dilly 2020-07-18 19:13:16 +02:00
parent 58a1719c98
commit e7d17b2cf1

View file

@ -79,9 +79,6 @@ fn main() -> Result<()> {
return Ok(());
}
// TODO: To be removed in a future version, when upgrading from 0.6.x or earlier is unlikely
migrate_config()?;
setup_terminal()?;
defer! {
shutdown_terminal().expect("shutdown failed");
@ -229,23 +226,6 @@ fn start_terminal<W: Write>(
Ok(terminal)
}
fn migrate_config() -> Result<()> {
let cache_path: PathBuf = get_app_cache_path()?;
let entries = cache_path.read_dir()?.flatten().filter(|entry| {
!entry.file_name().to_string_lossy().ends_with(".log")
});
let config_path: PathBuf = get_app_config_path()?;
for entry in entries {
let mut config_path: PathBuf = config_path.clone();
config_path.push(entry.file_name());
fs::rename(entry.path(), config_path)?;
}
Ok(())
}
fn get_app_cache_path() -> Result<PathBuf> {
let mut path = dirs::cache_dir()
.ok_or_else(|| anyhow!("failed to find os cache dir."))?;