chore: --ui-enabled actually does something

feat/type-attributes
Tomáš Mládek 2022-10-22 12:50:52 +02:00
parent 6b6bbc2f75
commit f200ea824f
1 changed files with 8 additions and 5 deletions

View File

@ -151,7 +151,7 @@ fn main() -> Result<()> {
let desktop_enabled = !matches.is_present("NO_DESKTOP");
let trust_executables = matches.is_present("TRUST_EXECUTABLES");
let ui_enabled = ui_path.is_ok() && !matches.is_present("NO_UI");
let browser_enabled = desktop_enabled && !matches.is_present("NO_BROWSER");
let browser_enabled = desktop_enabled && ui_enabled && !matches.is_present("NO_BROWSER");
let preview_path = upend.path.join("previews");
#[cfg(feature = "previews")]
@ -267,11 +267,14 @@ fn main() -> Result<()> {
.service(routes::get_jobs)
.service(routes::get_info);
if let Some(ui_path) = &ui_path {
app.service(actix_files::Files::new("/", ui_path).index_file("index.html"))
} else {
app
if ui_enabled {
if let Some(ui_path) = &ui_path {
return app
.service(actix_files::Files::new("/", ui_path).index_file("index.html"));
}
}
app
});
let bind_result = server.bind(&bind);