pub fn run_pre_cache() -> Result<()> {
    let slow_tests_cookie = Path::new("./target/.slow_tests_cookie");
    if !slow_tests_cookie.exists() {
        panic!("slow tests were skipped on CI!")
    }
    rm_rf(slow_tests_cookie)?;

    for entry in Path::new("./target/debug").read_dir()? {
        let entry = entry?;
        if entry.file_type().map(|it| it.is_file()).ok() == Some(true) {
            // Can't delete yourself on windows :-(
            if !entry.path().ends_with("xtask.exe") {
                rm_rf(&entry.path())?
            }
        }
    }

    fs2::remove_file("./target/.rustc_info.json")?;
    let to_delete = ["ra_", "heavy_test", "xtask"];
    for &dir in ["./target/debug/deps", "target/debug/.fingerprint"].iter() {
        for entry in Path::new(dir).read_dir()? {
            let entry = entry?;
            if to_delete.iter().any(|&it| entry.path().display().to_string().contains(it)) {
                // Can't delete yourself on windows :-(
                if !entry.path().ends_with("xtask.exe") {
                    rm_rf(&entry.path())?
                }
            }
        }
    }

    Ok(())
}
/// Cleans the `./target` dir after the build such that only
/// dependencies are cached on CI.
Cleans the `./target` dir after the build such that only
dependencies are cached on CI.
Cleans the ` . / target ` dir after the build such that only dependencies are cached on CI .
pub fn run_pre_cache() -> Result<()> {
    let slow_tests_cookie = Path::new("./target/.slow_tests_cookie");
    if !slow_tests_cookie.exists() {
        panic!("slow tests were skipped on CI!")
    }
    rm_rf(slow_tests_cookie)?;
    for entry in Path::new("./target/debug").read_dir()? {
        let entry = entry?;
        if entry.file_type().map(|it| it.is_file()).ok() == Some(true) {
            // Can't delete yourself on windows :-(
            if !entry.path().ends_with("xtask.exe") {
                rm_rf(&entry.path())?
            }
        }
    }
    fs2::remove_file("./target/.rustc_info.json")?;
    let to_delete = ["ra_", "heavy_test", "xtask"];
    for &dir in ["./target/debug/deps", "target/debug/.fingerprint"].iter() {
        for entry in Path::new(dir).read_dir()? {
            let entry = entry?;
            if to_delete.iter().any(|&it| entry.path().display().to_string().contains(it)) {
                // Can't delete yourself on windows :-(
                if !entry.path().ends_with("xtask.exe") {
                    rm_rf(&entry.path())?
                }
            }
        }
    }
    Ok(())
}
pub fn run_pre_cache ( ) -> Result < ( ) > { let slow_tests_cookie = Path :: new ( " " ) ; if ! slow_tests_cookie . exists ( ) { panic ! ( " " ) } rm_rf ( slow_tests_cookie ) ? ; for entry in Path :: new ( " " ) . read_dir ( ) ? { let entry = entry ? ; if entry . file_type ( ) . map ( | it | it . is_file ( ) ) . ok ( ) == Some ( true ) { // Can't delete yourself on windows :-( if ! entry . path ( ) . ends_with ( " " ) { rm_rf ( & entry . path ( ) ) ? } } } fs2 :: remove_file ( " " ) ? ; let to_delete = [ " " , " " , " " ] ; for & dir in [ " " , " " ] . iter ( ) { for entry in Path :: new ( dir ) . read_dir ( ) ? { let entry = entry ? ; if to_delete . iter ( ) . any ( | & it | entry . path ( ) . display ( ) . to_string ( ) . contains ( it ) ) { // Can't delete yourself on windows :-( if ! entry . path ( ) . ends_with ( " " ) { rm_rf ( & entry . path ( ) ) ? } } } } Ok ( ( ) ) }
Cleans the `./target` dir after the build such that only
dependencies are cached on CI.
Cleans the ` . / target ` dir after the build such that only dependencies are cached on CI .