Bandaid solution for no prompt
This commit is contained in:
parent
16bb6a48a2
commit
033f41b0ac
13
src/main.rs
13
src/main.rs
@ -8,7 +8,7 @@ use matrix_sdk::{
|
||||
},
|
||||
Error, LoopCtrl,
|
||||
};
|
||||
use std::{path::PathBuf, sync::Mutex};
|
||||
use std::{path::PathBuf, sync::Mutex, env};
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
pub mod config;
|
||||
@ -183,7 +183,16 @@ async fn main() -> anyhow::Result<()> {
|
||||
}
|
||||
};
|
||||
|
||||
let _stdin_thread = tokio::spawn(prompt::prompt(client.to_owned()));
|
||||
// TODO: Better solution for this
|
||||
let mut no_prompt: bool = false;
|
||||
match env::var("NO_PROMPT") {
|
||||
Ok(e) => { if e.to_lowercase().contains("yes") { no_prompt = true; } },
|
||||
Err(_e) => ()
|
||||
};
|
||||
if !no_prompt {
|
||||
tokio::spawn(prompt::prompt(client.to_owned()));
|
||||
}
|
||||
|
||||
client.add_event_handler(on_room_message);
|
||||
client
|
||||
.sync_with_result_callback(sync_settings, |sync_result| async move {
|
||||
|
Loading…
Reference in New Issue
Block a user