cargo_util::paths

Function link_or_copy

Source
pub fn link_or_copy(src: impl AsRef<Path>, dst: impl AsRef<Path>) -> Result<()>
Expand description

Hardlink (file) or symlink (dir) src to dst if possible, otherwise copy it.

If the destination already exists, it is removed before linking.