prepare page, fix ui and logic
This commit is contained in:
@@ -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())?;
|
||||
|
||||
@@ -477,7 +477,7 @@ watch(currentDir, (newPath) => {
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-divider />
|
||||
<!-- <el-divider /> -->
|
||||
|
||||
<el-card class="box-card" shadow="hover">
|
||||
<template #header>
|
||||
|
||||
Reference in New Issue
Block a user