Skip to content

Commit

Permalink
add enviroment variable check to build.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
brayo-pip committed Apr 26, 2024
1 parent 1fd2df0 commit a9f96da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src-tauri/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
fn main() {
tauri_build::build()
let webui_var = std::env::var("AW_WEBUI_DIR");

if let Err(_) = webui_var {
panic!("AW_WEBUI_DIR environment variable not set, Try running make");
}
tauri_build::build();
}
2 changes: 1 addition & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fn main() {
println!("Using webui path: {}", var_path);
std::path::Path::new(var_path)
} else {
panic!("AW_WEBUI_DIR environment variable not set!\nTry running make");
panic!("AW_WEBUI_DIR environment variable not set, This should be unreachable!");
};

let asset_path = PathBuf::from(&webui_path);
Expand Down

0 comments on commit a9f96da

Please sign in to comment.