diff options
author | 2022-08-17 02:47:37 -0700 | |
---|---|---|
committer | 2022-08-17 02:47:37 -0700 | |
commit | b9fdefb4dc46e549e690c30d3d335314755438dc (patch) | |
tree | 68bc041a26c25a712909d49fc0b5f7b887623741 | |
parent | 7eae31ad49cd2f528c3657b03dc666f8137c1096 (diff) | |
download | touchpad-b9fdefb4dc46e549e690c30d3d335314755438dc.tar.gz touchpad-b9fdefb4dc46e549e690c30d3d335314755438dc.tar.zst touchpad-b9fdefb4dc46e549e690c30d3d335314755438dc.zip |
Adds build script to run protobuf compilation
-rw-r--r-- | rust/proto/build.rs | 16 |
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 |