We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 378e8e8 commit 5cb63a5Copy full SHA for 5cb63a5
aw-server/build.rs
@@ -1,7 +1,14 @@
1
use std::error::Error;
2
3
fn main() -> Result<(), Box<dyn Error>> {
4
- std::fs::create_dir_all("../aw-webui/dist").unwrap();
+ // if aw-webui/dist does not exist or is empty, print a warning
5
+ let path = std::path::Path::new("../aw-webui/dist");
6
+ if !path.exists() || path.read_dir()?.next().is_none() {
7
+ println!("cargo:warning=`./aw-webui/dist` is not built, compiling without webui");
8
+ }
9
+
10
+ // ensure folder exists, since macro requires it
11
+ std::fs::create_dir_all(path)?;
12
println!("cargo:rustc-env=AW_WEBUI_DIR=../aw-webui/dist");
13
14
Ok(())
0 commit comments