Fail if MEMGRAPH_CONFIG path exists
Reviewers: buda Reviewed By: buda Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D776
This commit is contained in:
parent
14064926b6
commit
4d02a4f607
@ -46,8 +46,16 @@ void load_config(int &argc, char **&argv) {
|
|||||||
if (getenv("HOME") != nullptr)
|
if (getenv("HOME") != nullptr)
|
||||||
configs.emplace_back(fs::path(getenv("HOME")) /
|
configs.emplace_back(fs::path(getenv("HOME")) /
|
||||||
fs::path(".memgraph/config"));
|
fs::path(".memgraph/config"));
|
||||||
if (getenv("MEMGRAPH_CONFIG") != nullptr)
|
{
|
||||||
configs.emplace_back(fs::path(getenv("MEMGRAPH_CONFIG")));
|
auto memgraph_config = getenv("MEMGRAPH_CONFIG");
|
||||||
|
if (memgraph_config != nullptr) {
|
||||||
|
auto path = fs::path(memgraph_config);
|
||||||
|
CHECK(fs::exists(path))
|
||||||
|
<< "MEMGRAPH_CONFIG environment variable set to nonexisting path: "
|
||||||
|
<< path.generic_string();
|
||||||
|
configs.emplace_back(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<std::string> flagfile_arguments;
|
std::vector<std::string> flagfile_arguments;
|
||||||
for (const auto &config : configs)
|
for (const auto &config : configs)
|
||||||
|
Loading…
Reference in New Issue
Block a user