From e070553cef4bb5ccd9faacc248179c42d738624f Mon Sep 17 00:00:00 2001 From: Christopher Durham Date: Mon, 2 Mar 2020 23:30:14 -0500 Subject: Clean xtask partial artifacts in `xtask pre-cache` --- xtask/src/lib.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'xtask') diff --git a/xtask/src/lib.rs b/xtask/src/lib.rs index 55cdee491..f48045d17 100644 --- a/xtask/src/lib.rs +++ b/xtask/src/lib.rs @@ -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())? + } } } } -- cgit v1.2.3