mirror of
https://github.com/italicsjenga/valence.git
synced 2024-12-23 14:31:30 +11:00
Specify rerun-if-changed files manually
This commit is contained in:
parent
f5f8264a70
commit
6be10bba5a
|
@ -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()?;
|
||||
|
|
Loading…
Reference in a new issue