Skip to content

Commit

Permalink
Merge branch 'master' into use-file-watcher-#1
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Dilly committed Jul 18, 2020
2 parents 91a0cb9 + e7d17b2 commit 94972d3
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,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");
Expand Down Expand Up @@ -231,23 +228,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."))?;
Expand Down

0 comments on commit 94972d3

Please sign in to comment.