From 1e7d28bada9e4d65f2c8737c2626053f0205eacb Mon Sep 17 00:00:00 2001 From: OMGeeky Date: Sun, 21 Apr 2024 17:42:04 +0200 Subject: [PATCH] allow settings path to be set with env var TWBA_CONFIG --- Cargo.toml | 2 +- src/lib.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 5cba646..cc1f8e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 diff --git a/src/lib.rs b/src/lib.rs index e56336f..a6d2954 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -704,6 +704,7 @@ pub async fn get_client<'a>() -> Result> { .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);