the function for the checking of the yaml file in passed in directory or parent directory if found return the parent path containing the yaml file
| 74 | // the function for the checking of the yaml file in passed in directory or parent directory |
| 75 | // if found return the parent path containing the yaml file |
| 76 | std::string |
| 77 | check_parent_path(const std::string &path) |
| 78 | { |
| 79 | std::string yaml_path = path; |
| 80 | if (yaml_path.back() == '/') { |
| 81 | yaml_path.pop_back(); |
| 82 | } |
| 83 | // go up to 4 level of parent directories |
| 84 | for (int i = 0; i < 4; i++) { |
| 85 | if (yaml_path.empty()) { |
| 86 | return {}; |
| 87 | } |
| 88 | if (exists(Layout::relative_to(yaml_path, "runroot.yaml"))) { |
| 89 | return yaml_path; |
| 90 | } |
| 91 | yaml_path = yaml_path.substr(0, yaml_path.find_last_of("/")); |
| 92 | } |
| 93 | return {}; |
| 94 | } |
| 95 | |
| 96 | // handle the path of the engine during parsing |
| 97 | static std::string |
no test coverage detected