the function for the checking of the yaml file in the passed in path if found return the path to the yaml file, if not return empty string.
| 52 | // the function for the checking of the yaml file in the passed in path |
| 53 | // if found return the path to the yaml file, if not return empty string. |
| 54 | static std::string |
| 55 | get_yaml_path(const std::string &path) |
| 56 | { |
| 57 | // yaml_file 2 and 3 are for temporary use in case the change may break for people using runroot already |
| 58 | // this can be removed in the future. |
| 59 | std::string yaml_file; |
| 60 | std::string yaml_file2; |
| 61 | std::string yaml_file3; |
| 62 | if (is_directory(path.c_str())) { |
| 63 | std::string yaml_file(Layout::relative_to(path, "runroot.yaml")); |
| 64 | if (exists(yaml_file)) { |
| 65 | return yaml_file; |
| 66 | } |
| 67 | std::string yaml_file2(Layout::relative_to(path, "runroot.yml")); |
| 68 | if (exists(yaml_file2)) { |
| 69 | return yaml_file2; |
| 70 | } |
| 71 | std::string yaml_file3(Layout::relative_to(path, "runroot_path.yml")); |
| 72 | if (exists(yaml_file3)) { |
| 73 | return yaml_file3; |
| 74 | } |
| 75 | } else if (exists(path)) { |
| 76 | return path; |
| 77 | } |
| 78 | return {}; |
| 79 | } |
| 80 | |
| 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 |
no test coverage detected