Config loader includes also look in profiles
When including configuration files from a table configuration or another
configuration file, look in both the current directory and the profiles
directory for the file to include.
@@ -44,7 +44,14 @@ public class CombinedConfigLoader {
private ConfigIncluder parent = null;
public ConfigObject include(ConfigIncludeContext context, String what) {
- return ConfigFactory.parseFileAnySyntax(new File(what)).root();
+ File file = new File(what);
+
+ // Attempt to locate the file
+ if (!file.exists()) {
+ file = new File("profiles", what);
+ }
+
+ return ConfigFactory.parseFileAnySyntax(file).root();
}
public ConfigIncluder withFallback(ConfigIncluder fallback) {
