Discards files that are not TOML
This commit is contained in:
parent
e657e55931
commit
9201e34a00
1 changed files with 6 additions and 4 deletions
|
@ -15,11 +15,13 @@ async fn main() {
|
||||||
let config_path = std::fs::read_dir(format!("{}/.config/makima", home::home_dir().unwrap().display())).unwrap();
|
let config_path = std::fs::read_dir(format!("{}/.config/makima", home::home_dir().unwrap().display())).unwrap();
|
||||||
let mut config_files: Vec<Config> = Vec::new();
|
let mut config_files: Vec<Config> = Vec::new();
|
||||||
for file in config_path {
|
for file in config_path {
|
||||||
let filename: String = file.as_ref().unwrap().file_name().into_string().unwrap()
|
let filename: String = file.as_ref().unwrap().file_name().into_string().unwrap();
|
||||||
.split(".toml").collect::<Vec<&str>>()[0].to_string();
|
if filename.contains(".toml") {
|
||||||
let config_file: Config = Config::new_from_file(file.unwrap().path().to_str().unwrap(), filename);
|
let name: String = filename.split(".toml").collect::<Vec<&str>>()[0].to_string();
|
||||||
|
let config_file: Config = Config::new_from_file(file.unwrap().path().to_str().unwrap(), name);
|
||||||
config_files.push(config_file);
|
config_files.push(config_file);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
let tasks: Vec<JoinHandle<()>> = Vec::new();
|
let tasks: Vec<JoinHandle<()>> = Vec::new();
|
||||||
start_monitoring_udev(config_files, tasks).await;
|
start_monitoring_udev(config_files, tasks).await;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue