Add EventSource enum and update SystemEvent in watcher.rs (M0 stub updated to support Task 5 clean deletion). Create patterns.rs with PatternFile/Pattern/MatchedEvent types, TOML loader, and classify() matching against source + text. Five unit tests covering journald, applog, no-match, and source discrimination cases.
38 lines
1.1 KiB
Rust
38 lines
1.1 KiB
Rust
mod commands;
|
|
mod config;
|
|
mod distro;
|
|
mod patterns;
|
|
mod tray;
|
|
mod watcher;
|
|
|
|
use commands::AppState;
|
|
use config::RobinConfig;
|
|
use std::sync::Mutex;
|
|
|
|
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
|
pub fn run() {
|
|
// TODO: log a warning when load() fails so users know their config was reset
|
|
let config = RobinConfig::load().unwrap_or_default();
|
|
|
|
tauri::Builder::default()
|
|
.plugin(tauri_plugin_log::Builder::default().build())
|
|
.plugin(tauri_plugin_notification::init())
|
|
.plugin(tauri_plugin_shell::init())
|
|
.plugin(tauri_plugin_fs::init())
|
|
.manage(AppState {
|
|
config: Mutex::new(config),
|
|
})
|
|
.setup(|app| {
|
|
tray::build_tray(&app.handle())?;
|
|
watcher::spawn();
|
|
Ok(())
|
|
})
|
|
.invoke_handler(tauri::generate_handler![
|
|
commands::get_config,
|
|
commands::needs_onboarding,
|
|
commands::complete_onboarding,
|
|
commands::update_notification_level,
|
|
])
|
|
.run(tauri::generate_context!())
|
|
.expect("error while running Robin");
|
|
}
|