From 88b166177ee2bf04723fedb82a14c5cef66e87da Mon Sep 17 00:00:00 2001 From: KCM Date: Mon, 30 Sep 2024 16:48:57 -0500 Subject: [PATCH] refactor: try cp. --- src/duel.js | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/duel.js b/src/duel.js index e35ed09..27fab4c 100755 --- a/src/duel.js +++ b/src/duel.js @@ -147,24 +147,7 @@ const duel = async args => { await mkdir(subDir) await Promise.all( compileFiles.map( - async file => { - const dest = join( - subDir, - relative(projectDir, file).replace(/^(\.\.\/)*/, ''), - ) - const { dir } = parse(dest) - - try { - await lstat(dir) - } catch (err) { - if (err.code === 'ENOENT') { - await mkdir(dir, { recursive: true }) - } - } - - return copyFile(file, dest) - }, - //cp(file, join(subDir, relative(projectDir, file).replace(/^(\.\.\/)*/, ''))), + cp(file, join(subDir, relative(projectDir, file).replace(/^(\.\.\/)*/, ''))), ), )