| 107 | } |
| 108 | |
| 109 | std::vector<std::string> Config::findIncludePath(const std::string& name, |
| 110 | const std::vector<std::string>& dirs) { |
| 111 | auto match1 = tryExpandPath(name, ""); |
| 112 | if (!match1.empty()) { |
| 113 | return match1; |
| 114 | } |
| 115 | if (const char* dir = std::getenv(Config::CONFIG_PATH_ENV)) { |
| 116 | if (auto res = tryExpandPath(dir, name); !res.empty()) { |
| 117 | return res; |
| 118 | } |
| 119 | } |
| 120 | for (const auto& dir : dirs) { |
| 121 | if (auto res = tryExpandPath(dir, name); !res.empty()) { |
| 122 | return res; |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | return {}; |
| 127 | } |
| 128 | |
| 129 | void Config::resolveConfigIncludes(Json::Value& config, int depth) { |
| 130 | Json::Value includes = config["include"]; |