diff --git a/src/config.rs b/src/config.rs index 1173e26..b4d5fbf 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,4 +1,4 @@ -use std::{collections::HashMap, fs, path::Path}; +use std::{collections::HashMap, fs}; use serde::{Serialize, Deserialize}; @@ -23,7 +23,8 @@ pub struct Host { } pub fn read() -> Result { - let yaml = fs::read_to_string(Path::new("config.yaml")).unwrap_or("".to_string()); + let path = format!("{}/config.yaml", env!("PWD")); + let yaml = fs::read_to_string(path).unwrap_or("".to_string()); let config: Config = match serde_yaml::from_str(&yaml) { Ok(c) => c, Err(_) => return Err(()) diff --git a/src/main.rs b/src/main.rs index 4d71a59..eb51a94 100644 --- a/src/main.rs +++ b/src/main.rs @@ -130,6 +130,6 @@ fn main() { } for handler in handles { - handler.join().unwrap(); + handler.join().unwrap_or(()); } }