use std::path::Path;
#[cfg(target_family = "unix")]
pub(crate) fn symlink(src: &Path, dest: &Path) -> Result<(), std::io::Error> {
std::os::unix::fs::symlink(src, dest)
}
#[cfg(target_family = "windows")]
pub(crate) fn symlink(src: &Path, dest: &Path) -> Result<(), std::io::Error> {
if src.is_dir() {
std::os::windows::fs::symlink_dir(src, dest)
} else {
std::os::windows::fs::symlink_file(src, dest)
}
}
#[cfg(target_family = "unix")]
pub(crate) fn remove_symlink(path: &Path) -> Result<(), std::io::Error> {
std::fs::remove_file(path)
}
#[cfg(target_family = "windows")]
pub(crate) fn remove_symlink(path: &Path) -> Result<(), std::io::Error> {
if path.is_dir() {
std::fs::remove_dir(path)
} else {
std::fs::remove_file(path)
}
}