Last cleanup

This commit is contained in:
2025-06-03 19:50:43 +02:00
parent f1d23cb495
commit d1832bc794
205 changed files with 178 additions and 36164 deletions

View File

@@ -1,7 +1,12 @@
use std::{fs::{self, File}, io::Write, process::Command};
use std::{fs::{exists, read_dir, remove_dir_all, File}, io::Write, process::Command};
fn main() {
if exists("src/models").unwrap() {
remove_dir_all("src/models").unwrap();
}
let _ =
Command::new("openapi-generator")
.args(["generate", "-i", "gamenight-api.yaml", "-g", "rust", "--global-property", "models"])
@@ -9,7 +14,7 @@ fn main() {
.expect("Failed to generate models sources for the gamenight API");
let mut file = File::create("src/models/mod.rs").unwrap();
let paths = fs::read_dir("./src/models").unwrap();
let paths = read_dir("./src/models").unwrap();
for path in paths {
let path = path.unwrap();
let path = path.path();
@@ -19,6 +24,6 @@ fn main() {
}
let line = format!("pub mod {};\n", stem.to_str().unwrap());
file.write(line.as_bytes()).unwrap();
let _ = file.write(line.as_bytes()).unwrap();
}
}