From adc914694e35137eca778bd6d3aefce9c77d491d Mon Sep 17 00:00:00 2001 From: Julian Freeman Date: Sun, 7 Dec 2025 20:54:53 -0400 Subject: [PATCH] prepare page, fix ui and logic --- src-tauri/src/lib.rs | 14 +++++++++----- src/App.vue | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 3147004..a0e4022 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -34,15 +34,19 @@ fn copy_directory(template_path: String, target_path: String, new_folder_name: S return Err("Template directory does not exist".to_string()); } - if destination.exists() { - return Err(format!("Destination directory already exists: {:?}", destination)); - } + // Remove the check for existing destination to allow merging/overwriting + // if destination.exists() { + // return Err(format!("Destination directory already exists: {:?}", destination)); + // } - // Create the destination directory first - std::fs::create_dir_all(&destination).map_err(|e| e.to_string())?; + // Create the destination directory first if it doesn't exist + if !destination.exists() { + std::fs::create_dir_all(&destination).map_err(|e| e.to_string())?; + } let mut options = CopyOptions::new(); options.content_only = true; + options.overwrite = true; // Enable overwrite for existing files fs_extra::dir::copy(template, &destination, &options) .map_err(|e| e.to_string())?; diff --git a/src/App.vue b/src/App.vue index 64fa610..f60cec2 100644 --- a/src/App.vue +++ b/src/App.vue @@ -477,7 +477,7 @@ watch(currentDir, (newPath) => { - +