the function for the checking of the yaml file in passed in directory or parent directory if found return the parent path to the yaml file
| 81 | // the function for the checking of the yaml file in passed in directory or parent directory |
| 82 | // if found return the parent path to the yaml file |
| 83 | static std::string |
| 84 | get_parent_yaml_path(const std::string &path) |
| 85 | { |
| 86 | std::string whole_path = path; |
| 87 | if (whole_path.back() == '/') { |
| 88 | whole_path.pop_back(); |
| 89 | } |
| 90 | // go up to 4 level of parent directories |
| 91 | for (int i = 0; i < 4; i++) { |
| 92 | if (whole_path.empty()) { |
| 93 | return {}; |
| 94 | } |
| 95 | std::string yaml_file = get_yaml_path(whole_path); |
| 96 | if (!yaml_file.empty()) { |
| 97 | return yaml_file; |
| 98 | } |
| 99 | whole_path = whole_path.substr(0, whole_path.find_last_of('/')); |
| 100 | } |
| 101 | return {}; |
| 102 | } |
| 103 | |
| 104 | static void |
| 105 | runroot_extra_handling(const char *executable, bool json) |
no test coverage detected