Skip to content

Commit

Permalink
Fix path renaming
Browse files Browse the repository at this point in the history
Signed-off-by: macdonst <[email protected]>
  • Loading branch information
macdonst committed May 15, 2024
1 parent a78828b commit d378896
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { copyFileSync, mkdirSync, statSync } = require('fs')
const { join, normalize, sep } = require('path')
const { globSync } = require('glob')

const SRC_DIR = 'ts'
Expand All @@ -12,7 +13,9 @@ function copyAllFiles () {
}

function copyOneFile (srcPath) {
const destPath = srcPath.replace(SRC_DIR, DEST_DIR)
const cwd = process.cwd()
const src = srcPath.startsWith(sep) ? normalize(srcPath) : join(cwd, srcPath)
const destPath = src.replace(join(cwd, SRC_DIR), join(cwd, DEST_DIR))
const stats = statSync(srcPath)
if (stats.isDirectory()) {
mkdirSync(destPath, { recursive: true })
Expand Down

0 comments on commit d378896

Please sign in to comment.