Skip to content

Commit 1987d87

Browse files
alikatesalikates
and
alikates
authored
Fix copying vendored files when they are symbolic links (#183)
Co-authored-by: alikates <[email protected]>
1 parent 306a7a0 commit 1987d87

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/cmd/vendor.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -757,14 +757,18 @@ pub fn copy_recursively(
757757
}
758758

759759
let filetype = entry.file_type()?;
760+
let canonical_path_filetype =
761+
std::fs::metadata(std::fs::canonicalize(entry.path()).unwrap())
762+
.unwrap()
763+
.file_type();
760764
if filetype.is_dir() {
761765
copy_recursively(
762766
entry.path(),
763767
destination.as_ref().join(entry.file_name()),
764768
includes,
765769
ignore,
766770
)?;
767-
} else if filetype.is_symlink() {
771+
} else if filetype.is_symlink() && canonical_path_filetype.is_dir() {
768772
let orig = std::fs::read_link(entry.path());
769773
symlink_dir(orig.unwrap(), destination.as_ref().join(entry.file_name()))?;
770774
} else {

0 commit comments

Comments
 (0)