Skip to content

Commit

Permalink
Apply modified patch from #102
Browse files Browse the repository at this point in the history
Closes #102
  • Loading branch information
SuperCuber committed Jun 26, 2022
1 parent 8c8d3d4 commit 8cf27d6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,17 @@ fn merge_configuration_files(
}

for (variable_name, variable_value) in package.variables {
if first_package.variables.contains_key(&variable_name) {
anyhow::bail!("variable {:?} already encountered", variable_name);
if let Some(first_value) = first_package.variables.get_mut(&variable_name).as_mut()
{
match (first_value, variable_value) {
(toml::Value::Table(first_value), toml::Value::Table(variable_value)) => {
trace!("Merging {:?} tables", variable_name);
recursive_extend_map(first_value, variable_value);
}
_ => {
anyhow::bail!("variable {:?} already encountered", variable_name);
}
}
} else {
first_package
.variables
Expand Down

0 comments on commit 8cf27d6

Please sign in to comment.