optional "desktop" feature
This commit is contained in:
parent
4ce227b82d
commit
ac1e110b02
2 changed files with 13 additions and 5 deletions
|
@ -48,10 +48,15 @@ walkdir = "2"
|
|||
tree_magic = "0.2.3"
|
||||
|
||||
dotenv = "0.15.0"
|
||||
webbrowser = "0.5.5"
|
||||
xdg = "^2.1"
|
||||
|
||||
webbrowser = { version = "^0.5.5", optional = true }
|
||||
|
||||
nonempty = "0.6.0"
|
||||
|
||||
[dev-dependencies]
|
||||
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));
|
||||
}
|
||||
|
||||
if !matches.is_present("NO_BROWSER") && ui_enabled {
|
||||
let ui_result = webbrowser::open(&format!("http://localhost:{}", bind.port()));
|
||||
if ui_result.is_err() {
|
||||
warn!("Could not open UI in browser!");
|
||||
#[cfg(feature = "desktop")]
|
||||
{
|
||||
if !matches.is_present("NO_BROWSER") && ui_enabled {
|
||||
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 a new issue