Skip to content
Snippets Groups Projects
Commit a34a6957 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Support jsonc config files

parent d9709e81
No related branches found
No related tags found
No related merge requests found
...@@ -292,18 +292,36 @@ static bool findConfiguration(const string &file, const vector<string> &paths) { ...@@ -292,18 +292,36 @@ static bool findConfiguration(const string &file, const vector<string> &paths) {
f = mergeConfig(FTL_GLOBAL_CONFIG_ROOT "/config.json"); f = mergeConfig(FTL_GLOBAL_CONFIG_ROOT "/config.json");
found |= f; found |= f;
if (f) LOG(INFO) << "Loaded config: " << FTL_GLOBAL_CONFIG_ROOT "/config.json"; if (f) LOG(INFO) << "Loaded config: " << FTL_GLOBAL_CONFIG_ROOT "/config.json";
f = mergeConfig(FTL_GLOBAL_CONFIG_ROOT "/config.jsonc");
found |= f;
if (f) LOG(INFO) << "Loaded config: " << FTL_GLOBAL_CONFIG_ROOT "/config.jsonc";
f = mergeConfig(FTL_LOCAL_CONFIG_ROOT "/config.json"); f = mergeConfig(FTL_LOCAL_CONFIG_ROOT "/config.json");
found |= f; found |= f;
if (f) LOG(INFO) << "Loaded config: " << FTL_LOCAL_CONFIG_ROOT "/config.json"; if (f) LOG(INFO) << "Loaded config: " << FTL_LOCAL_CONFIG_ROOT "/config.json";
f = mergeConfig(FTL_LOCAL_CONFIG_ROOT "/config.jsonc");
found |= f;
if (f) LOG(INFO) << "Loaded config: " << FTL_LOCAL_CONFIG_ROOT "/config.jsonc";
f = mergeConfig("./config.json"); f = mergeConfig("./config.json");
found |= f; found |= f;
if (f) LOG(INFO) << "Loaded config: " << "./config.json"; if (f) LOG(INFO) << "Loaded config: " << "./config.json";
f = mergeConfig("./config.jsonc");
found |= f;
if (f) LOG(INFO) << "Loaded config: " << "./config.jsonc";
for (auto p : paths) { for (auto p : paths) {
if (is_directory(p)) { if (is_directory(p)) {
f = mergeConfig(p+"/config.json"); f = mergeConfig(p+"/config.json");
found |= f; found |= f;
if (f) LOG(INFO) << "Loaded config: " << p << "/config.json"; if (f) LOG(INFO) << "Loaded config: " << p << "/config.json";
f = mergeConfig(p+"/config.jsonc");
found |= f;
if (f) LOG(INFO) << "Loaded config: " << p << "/config.jsonc";
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment