flakes/packages/spotify-adblock/0002-allow-setting-config-from-environment-variable.patch

25 lines
805 B
Diff
Raw Normal View History

2021-09-19 11:31:11 +07:00
From 9a6d08d266a5e138c08e822a6ffb761db644aead Mon Sep 17 00:00:00 2001
From: LavaDesu <me@lava.moe>
Date: Sun, 19 Sep 2021 11:28:45 +0700
Subject: [PATCH] allow setting config from environment variable
---
src/lib.rs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/lib.rs b/src/lib.rs
index 5a0d7bd961e..86f2ac04ebf 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -44,6 +45,7 @@ struct Config {
lazy_static! {
static ref CONFIG: Config = {
let config_paths = vec![
+ PathBuf::from(std::env::var("SPOTIFY_ADBLOCK_CONFIG").unwrap_or("".into())),
2021-09-19 11:31:11 +07:00
PathBuf::from("config.toml"),
#[allow(deprecated)] // std::env::home_dir() is only broken on Windows
std::env::home_dir().unwrap().join(".config/spotify-adblock/config.toml"),
--
2.32.0