Fix zip extraction and bins::infer_bin_dir_template (#869)

- Fix zip extraction code: Ensure dir is rwx and file is readable for curr user
 - Add more integration test for `ExtractedFiles`
 - Fix `bins::infer_bin_dir_template` introduced in #856

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2023-03-06 17:54:31 +11:00 committed by GitHub
parent 460522f5bd
commit 01c8ecb778
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 56 additions and 14 deletions

View file

@ -56,11 +56,7 @@ pub fn infer_bin_dir_template(data: &Data, extracted_files: &ExtractedFiles) ->
gen_possible_dirs
.into_iter()
.map(|gen_possible_dir| gen_possible_dir(name, target, version))
.find(|dirname| {
extracted_files
.get_dir(&data.bin_path.join(dirname))
.is_some()
})
.find(|dirname| extracted_files.get_dir(Path::new(&dirname)).is_some())
.map(|mut dir| {
dir.reserve_exact(1 + default_bin_dir_template.len());
dir += "/";