We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1bd7c47 commit 0bf277aCopy full SHA for 0bf277a
vss-accessor/build.rs
@@ -0,0 +1,23 @@
1
+extern crate prost_build;
2
+
3
+use std::fs;
4
+use std::fs::File;
5
+use std::path::Path;
6
7
+fn main() {
8
+ download_file(
9
+ "https://raw.githubusercontent.com/lightningdevkit/vss-server/main/app/src/main/proto/vss.proto",
10
+ "src/proto/vss.proto",
11
+ )
12
+ .unwrap();
13
14
+ prost_build::compile_protos(&["src/proto/vss.proto"], &["src/"]).unwrap();
15
+}
16
17
+fn download_file(url: &str, save_to: &str) -> Result<(), Box<dyn std::error::Error>> {
18
+ let mut response = reqwest::blocking::get(url)?;
19
+ fs::create_dir_all(Path::new(save_to).parent().unwrap())?;
20
+ let mut out_file = File::create(save_to)?;
21
+ response.copy_to(&mut out_file)?;
22
+ Ok(())
23
0 commit comments