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 })