mirror of https://github.com/zkat/cacache-rs.git
fix(link): Do not compile link support if not unix or windows
This commit is contained in:
parent
3eaeabebfb
commit
6035f1c905
|
|
@ -9,6 +9,9 @@ use crate::async_lib::AsyncRead;
|
|||
use crate::content::path;
|
||||
use crate::errors::{IoErrorExt, Result};
|
||||
|
||||
#[cfg(not(any(unix, windows)))]
|
||||
compile_error!("Symlinking is not supported on this platform.");
|
||||
|
||||
fn symlink_file<P, Q>(src: P, dst: Q) -> std::io::Result<()>
|
||||
where
|
||||
P: AsRef<Path>,
|
||||
|
|
@ -24,13 +27,6 @@ where
|
|||
use std::os::windows::fs::symlink_file;
|
||||
symlink_file(src, dst)
|
||||
}
|
||||
#[cfg(not(any(unix, windows)))]
|
||||
{
|
||||
Err(std::io::Error::new(
|
||||
std::io::ErrorKind::Other,
|
||||
"symlinking is not supported on this platform",
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn create_symlink(sri: Integrity, cache: &PathBuf, target: &PathBuf) -> Result<Integrity> {
|
||||
|
|
|
|||
Loading…
Reference in New Issue