windows support for modules

This commit is contained in:
Junko 2023-11-27 08:39:41 +01:00
parent 219805384b
commit d1b43786bc
1 changed files with 14 additions and 4 deletions

View File

@ -300,6 +300,15 @@ fn get(config_path: String) -> Result<(), &'static str> {
let _ = remove_file(&config.pfp_module.pfp_output_path); let _ = remove_file(&config.pfp_module.pfp_output_path);
} }
if cfg!(target_os = "windows") {
Command::new("cmd").arg("/C").arg(format!("copy {}/{} {}", &config.pfp_module.pfp_folder, pfpnames, &config.pfp_module.pfp_output_path)).output().expect("PFP module error");
if config.disc_module.enabled {
let mut c = Command::new("cmd").arg("/C").arg(format!("{} {}", &config.disc_module.python_path, &config.disc_module.script_path)).spawn().expect("Discord module error");
let _ = c.wait().expect("Error");
}
} else {
Command::new("sh").arg("-c").arg(format!("cp {}/{} {}", &config.pfp_module.pfp_folder, pfpnames, &config.pfp_module.pfp_output_path)).output().expect("PFP module error"); Command::new("sh").arg("-c").arg(format!("cp {}/{} {}", &config.pfp_module.pfp_folder, pfpnames, &config.pfp_module.pfp_output_path)).output().expect("PFP module error");
if config.disc_module.enabled { if config.disc_module.enabled {
@ -307,6 +316,7 @@ fn get(config_path: String) -> Result<(), &'static str> {
let _ = c.wait().expect("Error"); let _ = c.wait().expect("Error");
} }
} }
}
Ok(()) Ok(())
} }