fix build warnings
This commit is contained in:
@@ -2,6 +2,8 @@ use std::path::Path;
|
|||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
let is_ci = std::env::var("CI").is_ok();
|
||||||
|
|
||||||
// Verify that required directories exist at build time
|
// Verify that required directories exist at build time
|
||||||
let required_dirs = vec!["static", "templates", "node_modules"];
|
let required_dirs = vec!["static", "templates", "node_modules"];
|
||||||
|
|
||||||
@@ -18,10 +20,13 @@ fn main() {
|
|||||||
for dir in &missing_dirs {
|
for dir in &missing_dirs {
|
||||||
println!("cargo:warning= - {}", dir);
|
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
|
// Verify critical files
|
||||||
@@ -47,8 +52,10 @@ fn main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build mdBook documentation
|
// Build mdBook documentation (skip in CI — docs are built in Docker)
|
||||||
|
if !is_ci {
|
||||||
build_documentation();
|
build_documentation();
|
||||||
|
}
|
||||||
|
|
||||||
// Tell cargo to rerun if these directories change
|
// Tell cargo to rerun if these directories change
|
||||||
println!("cargo:rerun-if-changed=static/");
|
println!("cargo:rerun-if-changed=static/");
|
||||||
|
|||||||
Reference in New Issue
Block a user