optional "desktop" feature
parent
4ce227b82d
commit
ac1e110b02
|
@ -48,10 +48,15 @@ walkdir = "2"
|
||||||
tree_magic = "0.2.3"
|
tree_magic = "0.2.3"
|
||||||
|
|
||||||
dotenv = "0.15.0"
|
dotenv = "0.15.0"
|
||||||
webbrowser = "0.5.5"
|
|
||||||
xdg = "^2.1"
|
xdg = "^2.1"
|
||||||
|
|
||||||
|
webbrowser = { version = "^0.5.5", optional = true }
|
||||||
|
|
||||||
nonempty = "0.6.0"
|
nonempty = "0.6.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tempdir = "0.3.7"
|
tempdir = "0.3.7"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = ["desktop"]
|
||||||
|
desktop = ["webbrowser"]
|
11
src/main.rs
11
src/main.rs
|
@ -152,10 +152,13 @@ fn main() -> Result<()> {
|
||||||
actix::spawn(filesystem::rescan_vault(db_pool, vault_path, job_container));
|
actix::spawn(filesystem::rescan_vault(db_pool, vault_path, job_container));
|
||||||
}
|
}
|
||||||
|
|
||||||
if !matches.is_present("NO_BROWSER") && ui_enabled {
|
#[cfg(feature = "desktop")]
|
||||||
let ui_result = webbrowser::open(&format!("http://localhost:{}", bind.port()));
|
{
|
||||||
if ui_result.is_err() {
|
if !matches.is_present("NO_BROWSER") && ui_enabled {
|
||||||
warn!("Could not open UI in browser!");
|
let ui_result = webbrowser::open(&format!("http://localhost:{}", bind.port()));
|
||||||
|
if ui_result.is_err() {
|
||||||
|
warn!("Could not open UI in browser!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue