Skip to content

Commit

Permalink
Log config path when running dozer commands (#2340)
Browse files Browse the repository at this point in the history
* log path of config files

* log config path for files

---------

Co-authored-by: aaryaattrey <aarya@getdozer.io>
  • Loading branch information
aaryaattrey and aaryaattrey committed Jan 23, 2024
1 parent 1f95b1f commit 026e273
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dozer-cli/src/cli/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use dozer_types::tracing::info;
use dozer_types::{models::config::Config, serde_yaml};
use handlebars::Handlebars;
use std::collections::BTreeMap;
use std::env;
use std::io::{self, Read};
use std::sync::Arc;
use tokio::runtime::Runtime;
Expand Down Expand Up @@ -155,8 +156,14 @@ pub fn load_config_from_file(

let (config_template, files) = combine_config(config_path.clone(), input)?;
loaded_files.extend_from_slice(&files);
let current_directory = env::current_dir().unwrap();
let config_files_with_path: Vec<_> = loaded_files
.iter()
.map(|file| current_directory.join(file).to_string_lossy().to_string())
.collect();

match config_template {
Some(template) => Ok((parse_config(&template)?, loaded_files)),
Some(template) => Ok((parse_config(&template)?, config_files_with_path)),
None => Err(FailedToFindConfigurationFiles(config_path.join(", "))),
}
}
Expand Down

0 comments on commit 026e273

Please sign in to comment.