From e6d1e170fd8eafd2b320cfbaeff9f25a0ffea1b8 Mon Sep 17 00:00:00 2001 From: jasonwitty Date: Sun, 23 Aug 2026 23:50:04 -0700 Subject: [PATCH] fix build warnings --- build.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/build.rs b/build.rs index dd8257f..9337e58 100644 --- a/build.rs +++ b/build.rs @@ -2,6 +2,8 @@ use std::path::Path; use std::process::Command; fn main() { + let is_ci = std::env::var("CI").is_ok(); + // Verify that required directories exist at build time let required_dirs = vec!["static", "templates", "node_modules"]; @@ -18,10 +20,13 @@ fn main() { for dir in &missing_dirs { println!("cargo:warning= - {}", dir); } + } - if missing_dirs.contains(&"node_modules") { - println!("cargo:warning=Run 'npm install' to install frontend dependencies"); - } + // node_modules is only needed for local dev (Docker/CI install deps separately) + if !is_ci && !Path::new("node_modules").exists() { + println!( + "cargo:warning=node_modules not found — run 'npm install' for frontend dependencies" + ); } // Verify critical files @@ -47,8 +52,10 @@ fn main() { } } - // Build mdBook documentation - build_documentation(); + // Build mdBook documentation (skip in CI — docs are built in Docker) + if !is_ci { + build_documentation(); + } // Tell cargo to rerun if these directories change println!("cargo:rerun-if-changed=static/");