From 5f13713efb83663eeb4b4184fc7e589c235e5cc7 Mon Sep 17 00:00:00 2001 From: "av.novikov1" Date: Fri, 27 May 2022 11:03:47 +0300 Subject: [PATCH] fix loading .env by composer --- core-dump-composer/src/config.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core-dump-composer/src/config.rs b/core-dump-composer/src/config.rs index eedc7ee..2afaeca 100644 --- a/core-dump-composer/src/config.rs +++ b/core-dump-composer/src/config.rs @@ -1,3 +1,5 @@ +extern crate dotenv; + use clap::{App, Arg, ArgMatches}; use libcrio::ImageCommand; use log::error; @@ -71,6 +73,11 @@ impl CoreConfig { dot_env_path.pop(); dot_env_path.push(".env"); + match dotenv::from_path(dot_env_path.clone()) { + Ok(v) => v, + Err(e) => error!("error loading .env file {}", e), + } + let mut crictl_config_path = env::current_exe()?; crictl_config_path.pop(); crictl_config_path.push("crictl.yaml");