Skip to content

Commit

Permalink
修复当目标文件夹已经存在时,copy_dir_all报错 (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
fslongjin authored Mar 19, 2024
1 parent b856f1e commit 428e17c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl FileUtils {
/// 递归地复制给定目录下所有文件到另一个文件夹中
pub fn copy_dir_all(src: &Path, dst: &Path) -> Result<(), String> {
let mut cmd = Command::new("cp");
cmd.arg("-r").arg("./").arg(dst);
cmd.arg("-rf").arg("./").arg(dst);

cmd.current_dir(src);

Expand Down

0 comments on commit 428e17c

Please sign in to comment.