Specify rerun-if-changed files manually

This commit is contained in:
Ryan 2022-04-19 23:45:34 -07:00
parent f5f8264a70
commit 6be10bba5a

View file

@ -1,20 +1,10 @@
use std::fs;
use anyhow::Context;
use proc_macro2::{Ident, Span};
mod block;
pub fn main() -> anyhow::Result<()> {
// If any of the files in the data directory are modified, rerun the build
// script.
for entry in fs::read_dir("data")? {
let entry = entry?;
if entry.metadata()?.is_file() {
let buf = entry.path();
let path = buf.to_str().context("bad file name")?;
println!("cargo:rerun-if-changed={path}");
}
for file in ["blocks.json"] {
println!("cargo:rerun-if-changed=data/{file}");
}
block::build()?;