fix(bundler): ignore duplicated files in resource iter, closes #4126 (#4129)

This commit is contained in:
Lucas Fernandes Nogueira
2022-05-15 06:01:10 -07:00
committed by GitHub
parent e43ef69992
commit 3e702cf8b1
2 changed files with 12 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
"tauri-bundler": patch
---
Fixes processing of resources with glob patterns when there are nested directories on Windows.

View File

@@ -799,6 +799,13 @@ fn generate_resource_data(settings: &Settings) -> crate::Result<ResourceMap> {
.into_string()
.expect("failed to read resource path");
// In some glob resource paths like `assets/**/*` a file might appear twice
// because the `tauri_utils::resources::ResourcePaths` iterator also reads a directory
// when it finds one. So we must check it before processing the file.
if added_resources.contains(&resource_path) {
continue;
}
added_resources.push(resource_path.clone());
let resource_entry = ResourceFile {