Commit 40c1cee4 authored by Vercel's avatar Vercel

Fix: The rename function has cases for \"claude\"\, \"cursor\"\, and \"vscode\"…

Fix: The rename function has cases for \"claude\"\, \"cursor\"\, and \"vscode\" directories\, but these cases will never be executed because the function is only called on file basenames\, not directory names\. The copied files will end up in `claude/`\, `cursor/`\, and `vscode/` instead of `.claude/`\, `.cursor/`\, and `.vscode/`\.
parent a545b04e
...@@ -34,12 +34,21 @@ export const copy = async ( ...@@ -34,12 +34,21 @@ export const copy = async (
return Promise.all( return Promise.all(
sourceFiles.map(async (p) => { sourceFiles.map(async (p) => {
const dirName = dirname(p) const dirName = dirname(p)
const baseName = rename(basename(p)) const baseName = basename(p)
// Apply rename to both directory path and basename
let renamedDirName = dirName
if (parents && dirName !== '.') {
// Split the directory path and apply rename to each component
const dirParts = dirName.split('/')
renamedDirName = dirParts.map(part => rename(part)).join('/')
}
const renamedBaseName = rename(baseName)
const from = cwd ? resolve(cwd, p) : p const from = cwd ? resolve(cwd, p) : p
const to = parents const to = parents
? join(destRelativeToCwd, dirName, baseName) ? join(destRelativeToCwd, renamedDirName, renamedBaseName)
: join(destRelativeToCwd, baseName) : join(destRelativeToCwd, renamedBaseName)
// Ensure the destination directory exists // Ensure the destination directory exists
await mkdir(dirname(to), { recursive: true }) await mkdir(dirname(to), { recursive: true })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment