fix build warnings
This commit is contained in:
@@ -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/");
|
||||
|
||||
Reference in New Issue
Block a user