mirror of
https://github.com/Noratrieb/killjoy-turret.git
synced 2026-01-14 14:45:01 +01:00
help
This commit is contained in:
parent
43063e600f
commit
4d37c60700
1 changed files with 4 additions and 2 deletions
|
|
@ -26,8 +26,10 @@ impl EventHandler for Handler {
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
let file_path = std::env::var("CONFIG_PATH").unwrap_or_else(|_| "./config.json".to_string());
|
let file_path = std::env::var("CONFIG_PATH").unwrap_or_else(|_| "./config.json".to_string());
|
||||||
println!("reading config from {file_path}");
|
let file = match fs::read_to_string(file_path).unwrap_or_else(|err| {
|
||||||
let file = fs::read_to_string(file_path).unwrap();
|
eprintln!("Error reading config file ({file_path}): {err}");
|
||||||
|
std::process:exit(1);
|
||||||
|
});
|
||||||
let config = serde_json::from_str::<ConfigFile>(&file).unwrap();
|
let config = serde_json::from_str::<ConfigFile>(&file).unwrap();
|
||||||
|
|
||||||
let token = &config.token;
|
let token = &config.token;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue