Skip to content

Commit

Permalink
Consider also the content of the main file
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicogene committed Apr 18, 2024
1 parent 04ad5e3 commit ecb2b9b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/creo2urdf/src/Creo2Urdf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -724,19 +724,15 @@ bool Creo2Urdf::loadYamlConfig(const std::string& filename)
{
try
{
auto config_temp = YAML::LoadFile(filename);
auto folder_path = extractFolderPath(filename);
if (config_temp["includes"].IsDefined() && config_temp["includes"].IsSequence()) {
for (const auto& include : config_temp["includes"]) {
auto config = YAML::LoadFile(filename);
if (config["includes"].IsDefined() && config["includes"].IsSequence()) {
auto folder_path = extractFolderPath(filename);
for (const auto& include : config["includes"]) {
auto include_filename = folder_path + include.as<std::string>();
auto include_config = YAML::LoadFile(include_filename);
mergeYAMLNodes(config, include_config);
}
}
else
{
config = config_temp;
}
}
catch (YAML::BadFile file_does_not_exist)
{
Expand Down

0 comments on commit ecb2b9b

Please sign in to comment.