mirror of
https://github.com/gitui-org/gitui
synced 2026-05-23 17:08:21 +00:00
remove config migration code
This commit is contained in:
parent
58a1719c98
commit
e7d17b2cf1
1 changed files with 0 additions and 20 deletions
20
src/main.rs
20
src/main.rs
|
|
@ -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."))?;
|
||||
|
|
|
|||
Loading…
Reference in a new issue