| 59 | } |
| 60 | |
| 61 | static std::string get_manifest_path(const std::string & repo, const std::string & tag) { |
| 62 | // we use "=" to avoid clashing with other component, while still being allowed on windows |
| 63 | std::string fname = "manifest=" + repo + "=" + tag + ".json"; |
| 64 | if (!validate_repo_name(repo)) { |
| 65 | throw std::runtime_error("error: repo name must be in the format 'owner/repo'"); |
| 66 | } |
| 67 | string_replace_all(fname, "/", "="); |
| 68 | return fs_get_cache_file(fname); |
| 69 | } |
| 70 | |
| 71 | static std::string read_file(const std::string & fname) { |
| 72 | std::ifstream file(fname); |
no test coverage detected