From cee33671b23eac8fc9a14615aef85a62f24e3191 Mon Sep 17 00:00:00 2001 From: Mutzi Date: Mon, 30 Jan 2023 16:33:12 +0100 Subject: [PATCH] Fixed directory copy --- src/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.rs b/src/utils.rs index 4623b11..22f6d40 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -51,7 +51,7 @@ pub fn get_dir_content_filtered(p: &Path, ignored: &[String], pb: &indicatif::Pr } pub fn copy_dir(src_dir: &Path, dst_dir: &Path, ignored: &[String], pb: &indicatif::ProgressBar) -> Result<(), String> { - let src_dir_len = src_dir.iter().count(); + let src_dir_len = src_dir.canonicalize().unwrap().iter().count(); let trim_fn = |p: PathBuf| { let new_path = p.into_iter().skip(src_dir_len).collect::(); (new_path.iter().count() != 0).then_some(new_path).or_else(|| { pb.set_length(pb.length().unwrap() - 1); None })