From c772a16cb762efe3e2181495870efb193c8f330c Mon Sep 17 00:00:00 2001 From: aumetra Date: Sat, 9 Dec 2023 21:13:48 +0100 Subject: [PATCH] delete directory before copy --- kitsune/build.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/kitsune/build.rs b/kitsune/build.rs index c42d33c73..5f3b3e8bb 100644 --- a/kitsune/build.rs +++ b/kitsune/build.rs @@ -1,4 +1,4 @@ -use camino::Utf8PathBuf; +use camino::Utf8Path; use fs_extra::dir::{self, CopyOptions}; use std::{env, error::Error, io, process::Command}; @@ -22,8 +22,10 @@ fn main() -> Result<(), Box> { println!("cargo:rerun-if-changed=assets"); println!("cargo:rerun-if-changed=templates"); - let assets_path = Utf8PathBuf::from("./assets").canonicalize_utf8()?; - let prepared_assets_path = Utf8PathBuf::from("./assets-dist").canonicalize_utf8()?; + let assets_path = Utf8Path::new("./assets").canonicalize_utf8()?; + let prepared_assets_path = Utf8Path::new("./assets-dist").canonicalize_utf8()?; + + dir::remove(&prepared_assets_path)?; let copy_options = CopyOptions { overwrite: true,