24 lines
686 B
Rust
24 lines
686 B
Rust
|
|
use std::fs;
|
||
|
|
use std::path::Path;
|
||
|
|
|
||
|
|
fn main() {
|
||
|
|
let dist_dir = Path::new("../frontend/dist");
|
||
|
|
|
||
|
|
println!("cargo:rerun-if-changed=build.rs");
|
||
|
|
|
||
|
|
if let Ok(entries) = fs::read_dir(dist_dir) {
|
||
|
|
for entry in entries.flatten() {
|
||
|
|
let path = entry.path();
|
||
|
|
if path.is_dir() {
|
||
|
|
if let Ok(sub_entries) = fs::read_dir(&path) {
|
||
|
|
for sub_entry in sub_entries.flatten() {
|
||
|
|
println!("cargo:rerun-if-changed={}", sub_entry.path().display());
|
||
|
|
}
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
println!("cargo:rerun-if-changed={}", path.display());
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|