diff --git a/build.rs b/build.rs index 1300a96..bb45018 100644 --- a/build.rs +++ b/build.rs @@ -15,23 +15,9 @@ fn git_hash() { .unwrap_or_default(); let hash = output.trim(); println!("cargo:rustc-env=GIT_HASH={hash}"); - println!("cargo:rerun-if-changed=.git/HEAD"); - println!("cargo:rerun-if-changed=.git/refs/heads/"); } fn tailwind() { - // Rerun when any template or static file changes - for entry in walkdir("templates") { - println!("cargo:rerun-if-changed={entry}"); - } - for entry in walkdir("static") { - // Skip the generated output file to avoid circular rebuilds - if entry == "static/css/styles.css" { - continue; - } - println!("cargo:rerun-if-changed={entry}"); - } - let mut cmd = Command::new("tailwindcss"); cmd.args(["-i", "static/css/input.css", "-o", "static/css/styles.css"]); @@ -52,22 +38,3 @@ fn tailwind() { } } } - -fn walkdir(dir: &str) -> Vec { - let mut files = Vec::new(); - let mut stack = vec![std::path::PathBuf::from(dir)]; - while let Some(path) = stack.pop() { - let Ok(entries) = std::fs::read_dir(&path) else { - continue; - }; - for entry in entries.flatten() { - let path = entry.path(); - if path.is_dir() { - stack.push(path); - } else { - files.push(path.display().to_string()); - } - } - } - files -}