diff --git a/src/template/src/main.rs b/src/template/src/main.rs index 0dbe1e9..a7e034a 100644 --- a/src/template/src/main.rs +++ b/src/template/src/main.rs @@ -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 { diff --git a/tests/common/mod.rs b/tests/common/mod.rs index faab988..0e48bde 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -600,17 +600,8 @@ impl BundlerTestHelper { fs::set_permissions(executable_path, perms)?; } - let mut cmd = if cfg!(windows) { - // On Windows, run batch files through cmd.exe - let mut cmd = Command::new("cmd"); - cmd.args(["/C", executable_path.to_str().unwrap()]); - cmd.args(args); - cmd - } else { - let mut cmd = Command::new(executable_path); - cmd.args(args); - cmd - }; + let mut cmd = Command::new(executable_path); + cmd.args(args); for (key, value) in env_vars { cmd.env(key, value);