refactor: normalize file path

This commit is contained in:
zhom
2025-07-28 17:58:39 +04:00
parent 573d39c0b5
commit 6f80b5ac13
2 changed files with 11 additions and 13 deletions
+9 -2
View File
@@ -88,9 +88,16 @@ fn extract_application(app_dir: &Path) -> Result<()> {
for i in 0..archive.len() {
let mut file = archive.by_index(i).context("Failed to read zip entry")?;
let outpath = app_dir.join(file.name());
if file.name().ends_with('/') {
// Normalize the file path for the current platform
// Zip files use forward slashes, but we need proper path separators for the OS
let file_name = file.name();
// Use Path::new to properly handle path separators across platforms
let normalized_path = Path::new(file_name);
let outpath = app_dir.join(normalized_path);
if file_name.ends_with('/') {
// Directory
fs::create_dir_all(&outpath).context("Failed to create directory")?;
} else {