From 6f63b4c95c26b85b040822cab5678772db42edc4 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Tue, 30 Mar 2021 18:46:14 +0000 Subject: [PATCH] main: add LOHR_CONFIG variable --- src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.rs b/src/main.rs index e71ec3d..ce09507 100644 --- a/src/main.rs +++ b/src/main.rs @@ -52,6 +52,9 @@ fn repo_updater(rx: Receiver, homedir: PathBuf, config: GlobalSettings) { fn parse_config(mut path: PathBuf) -> anyhow::Result { path.push("lohr-config"); path.set_extension("yaml"); + let path = env::var("LOHR_CONFIG") + .map(Into::into) + .unwrap_or_else(|_| path); let config = if let Ok(file) = File::open(path.as_path()) { serde_yaml::from_reader(file)? } else {