chore: sync workspace changes

This commit is contained in:
Nathan Flurry 2026-01-25 01:57:16 -08:00
parent 30d3aca1ee
commit f92ecd9b9a
38 changed files with 4829 additions and 1219 deletions

View file

@ -0,0 +1,40 @@
use std::env;
use std::fs;
use std::path::PathBuf;
fn main() {
let mut out: Option<PathBuf> = None;
let mut stdout = false;
let mut args = env::args().skip(1).peekable();
while let Some(arg) = args.next() {
if arg == "--stdout" {
stdout = true;
continue;
}
if arg == "--out" {
if let Some(value) = args.next() {
out = Some(PathBuf::from(value));
}
continue;
}
if let Some(value) = arg.strip_prefix("--out=") {
out = Some(PathBuf::from(value));
continue;
}
if out.is_none() {
out = Some(PathBuf::from(arg));
}
}
let schema = sandbox_daemon_openapi_gen::OPENAPI_JSON;
if stdout {
println!("{schema}");
return;
}
let out = out.unwrap_or_else(|| PathBuf::from("openapi.json"));
if let Err(err) = fs::write(&out, schema) {
eprintln!("failed to write {}: {err}", out.display());
std::process::exit(1);
}
}