(context: &Context, path: &Path)
| 442 | } |
| 443 | |
| 444 | pub(crate) async fn create_folder(context: &Context, path: &Path) -> Result<(), io::Error> { |
| 445 | let path_abs = get_abs_path(context, path); |
| 446 | if !path_abs.exists() { |
| 447 | match fs::create_dir_all(path_abs).await { |
| 448 | Ok(_) => Ok(()), |
| 449 | Err(err) => { |
| 450 | warn!( |
| 451 | context, |
| 452 | "Cannot create directory \"{}\": {}", |
| 453 | path.display(), |
| 454 | err |
| 455 | ); |
| 456 | Err(err) |
| 457 | } |
| 458 | } |
| 459 | } else { |
| 460 | Ok(()) |
| 461 | } |
| 462 | } |
| 463 | |
| 464 | /// Write a the given content to provided file path. |
| 465 | pub(crate) async fn write_file( |
no test coverage detected