From 7d1f863d6efd1897cd55149f489d2a42645bcbb7 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sat, 14 Mar 2026 12:38:31 +0100 Subject: [PATCH] http_client: Fix github downloads failing if the destination path exists --- crates/http_client/src/github_download.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/http_client/src/github_download.rs b/crates/http_client/src/github_download.rs index 642bbf11c11ce8..2ef615ff64c2b5 100644 --- a/crates/http_client/src/github_download.rs +++ b/crates/http_client/src/github_download.rs @@ -155,6 +155,7 @@ async fn cleanup_staging_path(staging_path: &Path, asset_kind: AssetKind) { } async fn finalize_download(staging_path: &Path, destination_path: &Path) -> Result<()> { + _ = async_fs::remove_dir_all(destination_path).await; async_fs::rename(staging_path, destination_path) .await .with_context(|| format!("renaming {staging_path:?} to {destination_path:?}"))?;