summary history branches tags files
commit:fb5d39bc10abaeb50c521eac4c60bf09017af457
author:Trevor Bentley
committer:Trevor Bentley
date:Wed Jul 10 18:32:15 2019 +0200
parents:7bc468686219bb52a41bed50e573a55b98185fd6
prefer local connectr.ini to ~/.connectr.ini
diff --git a/src/settings/mod.rs b/src/settings/mod.rs
line changes: +4/-4
index 5157a99..e0f2389
--- a/src/settings/mod.rs
+++ b/src/settings/mod.rs
@@ -62,15 +62,15 @@ fn default_inifile() -> String {
 }
 
 fn inifile() -> String {
-    // Try to load INI file from home directory
-    let path = format!("{}/.{}", dirs::home_dir().unwrap().display(), INIFILE);
+    // Default to looking in current working directory
+    let path = INIFILE.to_string();
     if path::Path::new(&path).exists() {
         info!("Found config: {}", path);
         return path;
     }
 
-    // Default to looking in current working directory
-    let path = INIFILE.to_string();
+    // Try to load INI file from home directory
+    let path = format!("{}/.{}", dirs::home_dir().unwrap().display(), INIFILE);
     if path::Path::new(&path).exists() {
         info!("Found config: {}", path);
         return path;