This commit is contained in:
Lily Tsuru 2024-09-30 07:04:34 -04:00
parent eb36172d6a
commit 068ef70e7e

View file

@ -121,6 +121,7 @@ pub async fn take_one_screenshot(
now.second() now.second()
)); ));
let file_path_clone = file_path.clone(); let file_path_clone = file_path.clone();
let _: anyhow::Result<()> = let _: anyhow::Result<()> =
@ -148,6 +149,10 @@ pub async fn take_one_screenshot(
let encoder = webp::Encoder::from_image(&image) let encoder = webp::Encoder::from_image(&image)
.expect("fuck you"); .expect("fuck you");
if !file_path_clone.exists() {
std::fs::create_dir_all(&file_path_clone)?;
}
let mut file = let mut file =
std::fs::File::create(file_path_clone)?; std::fs::File::create(file_path_clone)?;