Clean xtask partial artifacts in xtask pre-cache

This commit is contained in:
Christopher Durham 2020-03-02 23:30:14 -05:00 committed by CAD97
parent ce5684216e
commit e070553cef
2 changed files with 6 additions and 3 deletions

View file

@ -87,7 +87,7 @@ jobs:
- name: Prepare cache 2
if: matrix.os == 'windows-latest'
run: Remove-Item ./target/debug/xtask.exe
run: Remove-Item ./target/debug/xtask.exe, ./target/debug/deps/xtask.exe
typescript:
name: TypeScript

View file

@ -139,12 +139,15 @@ pub fn run_pre_cache() -> Result<()> {
}
fs2::remove_file("./target/.rustc_info.json")?;
let to_delete = ["ra_", "heavy_test"];
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)) {
rm_rf(&entry.path())?
// Can't delete yourself on windows :-(
if !entry.path().ends_with("xtask.exe") {
rm_rf(&entry.path())?
}
}
}
}