17 lines
394 B
JavaScript
17 lines
394 B
JavaScript
const fsPromises = require("fs/promises");
|
|
const fs = require('fs-extra')
|
|
|
|
// Delete a directory and its children
|
|
function copyFolder(sourcePath, destPath) {
|
|
|
|
fs.copySync(sourcePath, destPath, { overwrite: true }, (err) => {
|
|
if (err) {
|
|
console.error(err);
|
|
} else {
|
|
console.log("Copy dir success!");
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
module.exports = copyFolder; |