veplayer-mp-douyin
Advanced tools
Comparing version 1.0.3-alpha.7 to 1.0.3-alpha.8
{ | ||
"name": "veplayer-mp-douyin", | ||
"version": "1.0.3-alpha.7", | ||
"version": "1.0.3-alpha.8", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "miniprogramType": "tt-npm", |
const path = require('path'); | ||
const fs = require('fs'); | ||
function copyFolderSync(source, target) { | ||
if (!fs.existsSync(target)) { | ||
fs.mkdirSync(target); | ||
} | ||
fs.readdirSync(source).forEach((file) => { | ||
const sourcePath = path.join(source, file); | ||
const targetPath = path.join(target, file); | ||
if (fs.lstatSync(sourcePath).isDirectory()) { | ||
copyFolderSync(sourcePath, targetPath); | ||
} else { | ||
fs.copyFileSync(sourcePath, targetPath); | ||
} | ||
}); | ||
} | ||
async function main() { | ||
@@ -30,3 +47,3 @@ const isExitSrc = fs.existsSync(path.join(__dirname, '../../src')); | ||
targetPath = path.join(__dirname, `../../${isExitSrc ? 'src/' : ''}tcomponents/veplayer-mp-douyin`); | ||
fs.cpSync(sourcePath, targetPath, { overwrite: true }); | ||
copyFolderSync(sourcePath, targetPath); | ||
} | ||
@@ -33,0 +50,0 @@ } |
134237
2079