diff options
-rw-r--r-- | server/build.rs | 9 | ||||
-rw-r--r-- | server/src/routes/ui/style.rs | 12 |
2 files changed, 11 insertions, 10 deletions
diff --git a/server/build.rs b/server/build.rs index 8b067a6..fb31a66 100644 --- a/server/build.rs +++ b/server/build.rs @@ -1,4 +1,5 @@ -use std::process::Command; +#![feature(exit_status_error)] +use std::process::{Command, Stdio}; fn main() { println!("cargo:rerun-if-changed=build.rs"); @@ -8,7 +9,7 @@ fn main() { { println!("cargo:rerun-if-changed={}", file.to_str().unwrap()); } - Command::new("esbuild") + let mut proc = Command::new("esbuild") .arg("../web/script/main.ts") .arg("--bundle") .arg(format!( @@ -19,6 +20,8 @@ fn main() { .arg("--sourcemap") .arg("--sourcemap") .arg("--format=esm") - .output() + .stderr(Stdio::piped()) + .spawn() .unwrap(); + proc.wait().unwrap().exit_ok().unwrap(); } diff --git a/server/src/routes/ui/style.rs b/server/src/routes/ui/style.rs index 9a7fc48..171c3ce 100644 --- a/server/src/routes/ui/style.rs +++ b/server/src/routes/ui/style.rs @@ -14,13 +14,11 @@ macro_rules! concat_files { [ $($files),* ] .into_iter() .map(|n| { - read_to_string( - PathBuf::from_str(file!()).unwrap() - .parent().unwrap() - .parent().unwrap() - .parent().unwrap() - .join(n), - ) + read_to_string({ + let p = PathBuf::from_str(file!()).unwrap().parent().unwrap().join($base).join(n); + log::debug!("load {p:?}"); + p + }) .unwrap() }) .collect::<Vec<_>>() |