From 35185bb52c5c0f4e52f93698cc7c288c23ee6c92 Mon Sep 17 00:00:00 2001 From: pagoru Date: Mon, 2 Feb 2026 11:46:14 +0100 Subject: [PATCH 1/3] feat: add copy directoryu utility - fix #120 --- src/utils/path.utils.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/utils/path.utils.ts b/src/utils/path.utils.ts index 88a122b..5190398 100644 --- a/src/utils/path.utils.ts +++ b/src/utils/path.utils.ts @@ -16,3 +16,18 @@ export const getModulePath = (filePath: string = ""): string => { return path.isAbsolute(filePath) ? filePath : path.join(root, filePath); }; + +export const copyDirectory = async (srcPath: string, destPath: string)=> { + await Deno.mkdir(destPath, { recursive: true }); + + for await (const entry of Deno.readDir(srcPath)) { + const $srcPath = `${srcPath}/${entry.name}`; + const $destPath = `${destPath}/${entry.name}`; + + if (entry.isDirectory) { + await copyDirectory($srcPath, $destPath); + } else if (entry.isFile) { + await Deno.copyFile($srcPath, $destPath); + } + } +} \ No newline at end of file From 540eda05a50ca4f92c22876da1ec83920616d38b Mon Sep 17 00:00:00 2001 From: pagoru Date: Mon, 2 Feb 2026 11:55:01 +0100 Subject: [PATCH 2/3] feat: add copy directoryu utility - fix #120 --- src/utils/path.utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/path.utils.ts b/src/utils/path.utils.ts index 5190398..c750c80 100644 --- a/src/utils/path.utils.ts +++ b/src/utils/path.utils.ts @@ -17,7 +17,7 @@ export const getModulePath = (filePath: string = ""): string => { return path.isAbsolute(filePath) ? filePath : path.join(root, filePath); }; -export const copyDirectory = async (srcPath: string, destPath: string)=> { +export const copyDirectory = async (srcPath: string, destPath: string) => { await Deno.mkdir(destPath, { recursive: true }); for await (const entry of Deno.readDir(srcPath)) { @@ -30,4 +30,4 @@ export const copyDirectory = async (srcPath: string, destPath: string)=> { await Deno.copyFile($srcPath, $destPath); } } -} \ No newline at end of file +}; From 6d68ee385701aec44dd8a7f913c43361c26e31fc Mon Sep 17 00:00:00 2001 From: pagoru Date: Mon, 2 Feb 2026 11:56:07 +0100 Subject: [PATCH 3/3] feat: add copy directoryu utility - fix #120 --- src/utils/path.utils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/path.utils.ts b/src/utils/path.utils.ts index c750c80..c715e77 100644 --- a/src/utils/path.utils.ts +++ b/src/utils/path.utils.ts @@ -17,7 +17,10 @@ export const getModulePath = (filePath: string = ""): string => { return path.isAbsolute(filePath) ? filePath : path.join(root, filePath); }; -export const copyDirectory = async (srcPath: string, destPath: string) => { +export const copyDirectory = async ( + srcPath: string, + destPath: string, +): Promise => { await Deno.mkdir(destPath, { recursive: true }); for await (const entry of Deno.readDir(srcPath)) {