diff --git a/packages/cli-kit/src/public/node/fs.ts b/packages/cli-kit/src/public/node/fs.ts index 046c0f49e1..9251bbc784 100644 --- a/packages/cli-kit/src/public/node/fs.ts +++ b/packages/cli-kit/src/public/node/fs.ts @@ -717,21 +717,5 @@ export async function copyDirectoryContents(srcDir: string, destDir: string): Pr throw new Error(`Source directory ${srcDir} does not exist`) } - if (!(await fileExists(destDir))) { - await mkdir(destDir) - } - - // Get all files and directories in the source directory - const items = await glob(joinPath(srcDir, '**/*')) - - const filesToCopy = [] - - for (const item of items) { - const relativePath = item.replace(srcDir, '').replace(/^[/\\]/, '') - const destPath = joinPath(destDir, relativePath) - - filesToCopy.push(copyFile(item, destPath)) - } - - await Promise.all(filesToCopy) + await fsCopy(srcDir, destDir) }