(path: &str)
| 49 | } |
| 50 | |
| 51 | pub fn write_files<P: ResPathSource>(path: P, files: &[(&str, &str)]) -> io::Result<()> { |
| 52 | let path = writable_file_path(path.as_res_path_str())?; |
| 53 | if let Some(parent) = path.parent() { |
| 54 | std::fs::create_dir_all(parent)?; |
| 55 | } |
| 56 | let entries = files |
| 57 | .iter() |
| 58 | .map(|(source, name)| { |
| 59 | let source = readable_disk_path(source)?; |
| 60 | Ok(ZipEntry::new(source, *name)) |
| 61 | }) |
| 62 | .collect::<io::Result<Vec<_>>>()?; |
| 63 | perro_io::write_zip_file(path, &entries) |
no test coverage detected