mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-15 13:41:39 +03:00
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
This commit is contained in:
parent
2b6c24dff9
commit
787ea09adc
5
.changes/fix-resource-windows.md
Normal file
5
.changes/fix-resource-windows.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-bundler": patch
|
||||
---
|
||||
|
||||
Fixes resource bundling on Windows when the resource path includes root or parent directory components.
|
@ -14,6 +14,7 @@ use log::info;
|
||||
use regex::Regex;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sha2::Digest;
|
||||
use tauri_utils::resources::resource_relpath;
|
||||
use std::{
|
||||
collections::{BTreeMap, HashMap},
|
||||
fs::{create_dir_all, read_to_string, remove_dir_all, rename, write, File},
|
||||
@ -796,13 +797,10 @@ fn generate_resource_data(settings: &Settings) -> crate::Result<ResourceMap> {
|
||||
};
|
||||
|
||||
// split the resource path directories
|
||||
let components_count = src.components().count();
|
||||
let directories = src
|
||||
let target_path = resource_relpath(&src);
|
||||
let components_count = target_path.components().count();
|
||||
let directories = target_path
|
||||
.components()
|
||||
.filter(|component| {
|
||||
let comp = component.as_os_str();
|
||||
comp != "." && comp != ".."
|
||||
})
|
||||
.take(components_count - 1) // the last component is the file
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user