From 38cfbdcfb84cbce90805f574042b9256e64450f5 Mon Sep 17 00:00:00 2001 From: Neshura Date: Mon, 8 Apr 2024 22:18:51 +0200 Subject: [PATCH] Fix: stop checking config paths after finding a config file --- src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 84eb4f6..a0cfb25 100644 --- a/src/main.rs +++ b/src/main.rs @@ -132,8 +132,10 @@ impl Config { let mut system_path= system_config_paths[1]; for path in system_config_paths { - if path.exists() { + let cfg_path = path.join("config.toml"); + if cfg_path.exists() { system_path = path; + break; } }; @@ -159,7 +161,7 @@ async fn main() -> std::io::Result<()> { log::set_max_level(LevelFilter::Info); let config = Config::load().expect("Error while loading or generating the config"); - + let loaded_redirects_msg = format!("Loaded {} redirects from user config", config.user.domain_configs.len()); info!(loaded_redirects_msg);