Keep file permissions when extracting zip archives on Unix (#31304)

Follow-up of https://github.com/zed-industries/zed/pull/31080

Stop doing

```rs
#[cfg(not(windows))]
{
    file.set_permissions(<fs::Permissions as fs::unix::PermissionsExt>::from_mode(
        0o755,
    ))
    .await?;
}
```

after extracting zip archives on Unix, and use an API that provides the
file permissions data for each archive entry.

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov
2025-05-23 20:45:32 +00:00
committed by GitHub
parent ca72efe701
commit 7341ab3980
10 changed files with 150 additions and 91 deletions
+1 -1
View File
@@ -309,7 +309,7 @@ pub async fn download_adapter_from_github(
let mut file = File::create(&zip_path).await?;
futures::io::copy(response.body_mut(), &mut file).await?;
let file = File::open(&zip_path).await?;
extract_zip(&version_path, BufReader::new(file))
extract_zip(&version_path, file)
.await
// we cannot check the status as some adapter include files with names that trigger `Illegal byte sequence`
.ok();