Update: read messages from rules/**.toml

This commit is contained in:
itiB
2020-10-29 23:00:55 +09:00
parent c53b4b6f46
commit 1d8a9c19d2
8 changed files with 61 additions and 10 deletions

View File

@@ -5,12 +5,28 @@ use quick_xml::de::DeError;
use std::{fs, path::PathBuf, process};
use yamato_event_analyzer::detections::configs;
use yamato_event_analyzer::detections::detection;
use yamato_event_analyzer::detections::print;
use yamato_event_analyzer::detections::print::MESSAGES;
use yamato_event_analyzer::omikuji::Omikuji;
use yamato_event_analyzer::toml;
fn main() -> Result<(), DeError> {
configs::singleton();
let mut toml = toml::ParseToml::new();
&toml.read_dir("rules".to_string());
for rule in toml.rules {
match rule {
Ok(_rule) => {
let mut message = MESSAGES.lock().unwrap();
if let Some(messages) = _rule.rule.messages {
for (key, texts) in messages {
message.insert_message(key, texts);
}
}
}
Err(_) => (),
}
}
let filepath: String = configs::singleton()
.args