v0.4.0 phase 1: stale config cleanup, --help flag, gitignore

This commit is contained in:
2026-06-03 00:15:20 +02:00
parent 11c5eeee3f
commit 3e9d39c0ef
3 changed files with 33 additions and 0 deletions
+16
View File
@@ -23,6 +23,22 @@ pub fn accept_disclaimer() -> std::io::Result<()> {
Ok(())
}
/// Path to the stale `config.ini` from v0.3.0 and earlier.
pub fn stale_config_path() -> PathBuf {
exe_dir().join("config.ini")
}
/// Remove the stale `config.ini` if it exists. Returns `true` if removed.
pub fn cleanup_stale_config() -> bool {
let path = stale_config_path();
if path.exists() {
std::fs::remove_file(&path).ok();
true
} else {
false
}
}
/// Return the directory containing the running executable.
pub fn exe_dir() -> PathBuf {
std::env::current_exe()