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());
|
return Err("Template directory does not exist".to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
if destination.exists() {
|
// Remove the check for existing destination to allow merging/overwriting
|
||||||
return Err(format!("Destination directory already exists: {:?}", destination));
|
// if destination.exists() {
|
||||||
}
|
// return Err(format!("Destination directory already exists: {:?}", destination));
|
||||||
|
// }
|
||||||
|
|
||||||
// Create the destination directory first
|
// 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())?;
|
std::fs::create_dir_all(&destination).map_err(|e| e.to_string())?;
|
||||||
|
}
|
||||||
|
|
||||||
let mut options = CopyOptions::new();
|
let mut options = CopyOptions::new();
|
||||||
options.content_only = true;
|
options.content_only = true;
|
||||||
|
options.overwrite = true; // Enable overwrite for existing files
|
||||||
|
|
||||||
fs_extra::dir::copy(template, &destination, &options)
|
fs_extra::dir::copy(template, &destination, &options)
|
||||||
.map_err(|e| e.to_string())?;
|
.map_err(|e| e.to_string())?;
|
||||||
|
|||||||
@@ -477,7 +477,7 @@ watch(currentDir, (newPath) => {
|
|||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-divider />
|
<!-- <el-divider /> -->
|
||||||
|
|
||||||
<el-card class="box-card" shadow="hover">
|
<el-card class="box-card" shadow="hover">
|
||||||
<template #header>
|
<template #header>
|
||||||
|
|||||||
Reference in New Issue
Block a user