mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
hanzo-kai: the tree copy makes a symlink on Windows too
`copy` reached for std::os::unix::fs::symlink unguarded, so the windows-amd64 build of v0.7.0 failed at hanzo-kai while the four other targets built. Each platform's symlink call sits under its cfg; the other two unix-only sites in the Hanzo crates were already gated at the function and module.
This commit is contained in:
@@ -552,7 +552,14 @@ fn copy(from: &Path, to: &Path) -> std::io::Result<()> {
|
||||
let dest = to.join(&name);
|
||||
if kind.is_symlink() {
|
||||
if let Ok(target) = std::fs::read_link(e.path()) {
|
||||
let _ = std::os::unix::fs::symlink(target, dest);
|
||||
#[cfg(unix)]
|
||||
let _ = std::os::unix::fs::symlink(&target, &dest);
|
||||
#[cfg(windows)]
|
||||
let _ = if e.path().is_dir() {
|
||||
std::os::windows::fs::symlink_dir(&target, &dest)
|
||||
} else {
|
||||
std::os::windows::fs::symlink_file(&target, &dest)
|
||||
};
|
||||
}
|
||||
} else if kind.is_dir() {
|
||||
if !skipped(&name.to_string_lossy()) {
|
||||
|
||||
Reference in New Issue
Block a user