Fixed directory copy
This commit is contained in:
		@@ -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> {
 | 
					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 trim_fn = |p: PathBuf| {
 | 
				
			||||||
        let new_path = p.into_iter().skip(src_dir_len).collect::<PathBuf>();
 | 
					        let new_path = p.into_iter().skip(src_dir_len).collect::<PathBuf>();
 | 
				
			||||||
        (new_path.iter().count() != 0).then_some(new_path).or_else(|| { pb.set_length(pb.length().unwrap() - 1); None })
 | 
					        (new_path.iter().count() != 0).then_some(new_path).or_else(|| { pb.set_length(pb.length().unwrap() - 1); None })
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user