Fix config file location when XDG folders not set

This commit is contained in:
Sayantan Santra 2022-12-09 02:30:24 -06:00
parent 81095222ff
commit e5c73b5cea

View file

@ -65,6 +65,7 @@ fn main() {
let mut config_file = env::var("XDG_CONFIG_HOME").unwrap_or("$HOME".to_string()); let mut config_file = env::var("XDG_CONFIG_HOME").unwrap_or("$HOME".to_string());
if config_file == String::from("$HOME") { if config_file == String::from("$HOME") {
config_file = env::var("$HOME").unwrap(); config_file = env::var("$HOME").unwrap();
config_file.push_str("/.config");
} }
config_file.push_str("/movie_rename.conf"); config_file.push_str("/movie_rename.conf");
let mut config = load_str!(config_file.as_str()).lines(); let mut config = load_str!(config_file.as_str()).lines();