use crate::ops::persistence::PersistenceError;
use std::path::Path;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum ArtifactCommitOutcome {
Published,
Recovered,
}
pub fn commit_artifact_directory(
temporary: &Path,
canonical: &Path,
expected_checksum: &str,
) -> Result<ArtifactCommitOutcome, PersistenceError> {
#[cfg(any(target_os = "linux", target_os = "android", target_vendor = "apple"))]
{
supported::commit_with_hook(temporary, canonical, expected_checksum, |_, _| Ok(()))
}
#[cfg(not(any(target_os = "linux", target_os = "android", target_vendor = "apple")))]
{
let _ = (temporary, canonical, expected_checksum);
Err(PersistenceError::ArtifactCommitUnsupportedPlatform {
platform: std::env::consts::OS,
})
}
}
#[cfg(any(target_os = "linux", target_os = "android", target_vendor = "apple"))]
mod supported;
#[cfg(all(
test,
any(target_os = "linux", target_os = "android", target_vendor = "apple")
))]
mod regressions;
#[cfg(all(
test,
any(target_os = "linux", target_os = "android", target_vendor = "apple")
))]
mod tests;