summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rust/proto/build.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/rust/proto/build.rs b/rust/proto/build.rs
new file mode 100644
index 0000000..239e6f9
--- /dev/null
+++ b/rust/proto/build.rs
@@ -0,0 +1,16 @@
+use std::process::{Command, exit};
+
+fn main() -> Result<(), Box<dyn std::error::Error>> {
+ let buf_path = format!("{}/../../api", env!("CARGO_MANIFEST_DIR"));
+
+ let status = Command::new("buf")
+ .arg("generate")
+ .current_dir(buf_path)
+ .status()?;
+
+ if !status.success() {
+ exit(status.code().unwrap_or(-1))
+ }
+
+ Ok(())
+} \ No newline at end of file