//! For tools/winws-dry-run.sh: a preset's winws arguments as the service builds them, one //! per line. `zapret_args `, paths as //! Windows sees them (with a trailing separator). use ps_core::config::GameFilter; use ps_core::zapret::{expand, find_preset, preset_args}; fn main() { let a: Vec = std::env::args().collect(); let (release, win_root, win_lists, preset, game) = (&a[1], &a[2], &a[3], &a[4], &a[5]); let files: Vec = std::fs::read_dir(release).unwrap().filter_map(|e| e.ok()?.file_name().into_string().ok()).collect(); let file = find_preset(&files, preset).unwrap(); let text = std::fs::read_to_string(std::path::Path::new(release).join(file)).unwrap(); let game: GameFilter = serde_json::from_value(serde_json::json!(game)).unwrap(); for arg in expand(&preset_args(&text).unwrap(), &format!("{win_root}bin\\"), win_lists, win_root, game) { println!("{arg}"); } }