Skip to content

Commit

Permalink
Handle both new and old config existing
Browse files Browse the repository at this point in the history
  • Loading branch information
sondr3 committed Feb 15, 2024
1 parent ff6a284 commit 2a4cdeb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,14 @@ impl Config {
let config_file = config_file();
let old_config_file = old_config_file();

if old_config_file.exists() {
if config_file.exists() && old_config_file.exists() {
eprintln!(
"{}: Found both old and new config file, remove `{}` to silence this warning",
"WARN".bold().red(),
old_config_file.to_string_lossy().italic().blue()
);
Some(config_file)
} else if old_config_file.exists() {
eprintln!(
"{}: Found old config file, please run `{}` to move it. This file will be ignored in a future release.",
"WARN".bold().red(),
Expand Down

0 comments on commit 2a4cdeb

Please sign in to comment.