puppetlabs / cpp-hocon

A C++ port of the Typesafe Config library.
Other
81 stars 57 forks source link

Resolve included files before including them #97

Closed luben closed 6 years ago

luben commented 7 years ago

Fixes #95 : substitution inside the file should work without the full path where they are included.

puppetcla commented 7 years ago

CLA signed by all contributors.

MikaelSmith commented 6 years ago

Ah, sorry I missed this.

Can you add a test like https://github.com/puppetlabs/cpp-hocon/blob/master/lib/tests/conf_parser_test.cc#L627-L633 - but with file() removed - to the PR?

MikaelSmith commented 6 years ago

Also, thanks so much for investigating and putting together a fix!

luben commented 6 years ago

This PR does not fix include file("path") vs include "path" case but it's about resolving the substitutions in the included files: don't only consider path from the config root but also from the included file root.

MikaelSmith commented 6 years ago

Ah right, that would require a more complex example.

luben commented 6 years ago

Actually the fixtures already had an example pattern I can use. Sent a PR with the test,