From a6aee694dc6949a346b20cf84832ea57349ff3df Mon Sep 17 00:00:00 2001 From: zhom <2717306+zhom@users.noreply.github.com> Date: Mon, 28 Jul 2025 20:40:40 +0400 Subject: [PATCH] refactor: remove trailing slash for windows unpacking --- src/template/src/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/template/src/main.rs b/src/template/src/main.rs index 4375176..6b16d00 100644 --- a/src/template/src/main.rs +++ b/src/template/src/main.rs @@ -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() {