summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Anshul Gupta <ansg191@yahoo.com> 2022-08-17 02:47:37 -0700
committerGravatar Anshul Gupta <ansg191@yahoo.com> 2022-08-17 02:47:37 -0700
commitb9fdefb4dc46e549e690c30d3d335314755438dc (patch)
tree68bc041a26c25a712909d49fc0b5f7b887623741
parent7eae31ad49cd2f528c3657b03dc666f8137c1096 (diff)
downloadtouchpad-b9fdefb4dc46e549e690c30d3d335314755438dc.tar.gz
touchpad-b9fdefb4dc46e549e690c30d3d335314755438dc.tar.zst
touchpad-b9fdefb4dc46e549e690c30d3d335314755438dc.zip
Adds build script to run protobuf compilation
-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