refactor: remove trailing slash for windows unpacking

This commit is contained in:
zhom
2025-07-28 20:40:40 +04:00
parent 4e9e576049
commit a6aee694dc
+8 -1
View File
@@ -102,9 +102,16 @@ fn extract_application(app_dir: &Path) -> Result<()> {
// Determine if this is a directory entry
let is_directory = file_name.ends_with('/');
// Remove trailing slash for proper path construction
let clean_file_name = if is_directory {
file_name.trim_end_matches('/')
} else {
file_name
};
// Use proper path handling instead of string replacement
// Split the path by forward slashes and join using PathBuf for proper platform handling
let path_components: Vec<&str> = file_name.split('/').collect();
let path_components: Vec<&str> = clean_file_name.split('/').collect();
let mut outpath = app_dir.to_path_buf();
for component in path_components {
if !component.is_empty() {