mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-05-18 15:09:51 +00:00
Move IDL files to artifacts/ and add a convention-based CI check that discovers all programs via */methods/guest/src/bin/*.rs and fails if any program is missing its IDL or has one that is out of date.
20 lines
519 B
Rust
20 lines
519 B
Rust
use std::{path::PathBuf, process};
|
|
|
|
fn main() {
|
|
let path: PathBuf = match std::env::args().nth(1) {
|
|
Some(p) => PathBuf::from(p),
|
|
None => {
|
|
eprintln!("Usage: idl-gen <source-file>");
|
|
process::exit(1);
|
|
}
|
|
};
|
|
|
|
match spel_framework_core::idl_gen::generate_idl_from_file(&path) {
|
|
Ok(idl) => println!("{}", serde_json::to_string_pretty(&idl).unwrap()),
|
|
Err(e) => {
|
|
eprintln!("Error: {e}");
|
|
process::exit(1);
|
|
}
|
|
}
|
|
}
|