allow settings path to be set with env var TWBA_CONFIG

This commit is contained in:
OMGeeky
2024-04-21 17:42:04 +02:00
parent 908cbae28f
commit 1e7d28bada
2 changed files with 2 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "twba-twitch-data"
version = "0.3.0"
version = "0.3.1"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@@ -704,6 +704,7 @@ pub async fn get_client<'a>() -> Result<TwitchClient<'a>> {
.env()
.file("./settings.toml")
.file(shellexpand::tilde("~/twba/config.toml").into_owned())
.file(std::env::var("TWBA_CONFIG").unwrap_or_else(|_| "~/twba/config.toml".to_string()))
.load()
.expect("Failed to load config");
info!("get_client: config: {:?}", conf);