mirror of
https://github.com/gitui-org/gitui
synced 2026-05-24 09:28: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(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: To be removed in a future version, when upgrading from 0.6.x or earlier is unlikely
|
|
||||||
migrate_config()?;
|
|
||||||
|
|
||||||
setup_terminal()?;
|
setup_terminal()?;
|
||||||
defer! {
|
defer! {
|
||||||
shutdown_terminal().expect("shutdown failed");
|
shutdown_terminal().expect("shutdown failed");
|
||||||
|
|
@ -229,23 +226,6 @@ fn start_terminal<W: Write>(
|
||||||
Ok(terminal)
|
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> {
|
fn get_app_cache_path() -> Result<PathBuf> {
|
||||||
let mut path = dirs::cache_dir()
|
let mut path = dirs::cache_dir()
|
||||||
.ok_or_else(|| anyhow!("failed to find os cache dir."))?;
|
.ok_or_else(|| anyhow!("failed to find os cache dir."))?;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue