Skip to content

Commit e67dc5f

Browse files
authored
Merge pull request #6 from github/look/rerun-if
2 parents 0ad48c3 + c8bcaa8 commit e67dc5f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,16 @@ Add a `build.rs` file to your project to compile the protos and generate Rust co
3636

3737
```rust
3838
fn main() {
39+
let proto_source_files = ["./service.proto"];
40+
41+
// Tell Cargo to rerun this build script if any of the proto files change
42+
for entry in &proto_source_files {
43+
println!("cargo:rerun-if-changed={}", entry);
44+
}
45+
3946
prost_build::Config::new()
4047
.service_generator(twirp_build::service_generator())
41-
.compile_protos(&["./service.proto"], &["./"])
48+
.compile_protos(&proto_source_files, &["./"])
4249
.expect("error compiling protos");
4350
}
4451
```

0 commit comments

Comments
 (0)