mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-02 06:28:20 +03:00
replace remove_dir with remove_dir_all in helpers::symlink_dir
When using `symlink_dir`, it first removes the existing link with `remove_dir`. However, if the path isn't a link and contains files, `remove_dir` fails with "DirectoryNotEmpty", which causes the symbolic linking to fail as well. We have this problem on linking 'rustlib/rust' because it contains files as an actual directory. Signed-off-by: onur-ozkan <work@onurozkan.dev>
This commit is contained in:
@@ -135,7 +135,7 @@ pub fn symlink_dir(config: &Config, original: &Path, link: &Path) -> io::Result<
|
||||
if config.dry_run() {
|
||||
return Ok(());
|
||||
}
|
||||
let _ = fs::remove_dir(link);
|
||||
let _ = fs::remove_dir_all(link);
|
||||
return symlink_dir_inner(original, link);
|
||||
|
||||
#[cfg(not(windows))]
|
||||
|
||||
Reference in New Issue
Block a user