in lib/util.js [146:165]
function remove(...filesPath) {
filesPath.forEach(filePath => {
if (fs.existsSync(filePath)) {
if (fs.statSync(filePath).isDirectory()) {
const files = fs.readdirSync(filePath);
files.forEach((file, index) => {
let curPath = path.join(filePath, file);
if (fs.statSync(curPath).isDirectory()) {
remove(curPath);
} else {
fs.unlinkSync(curPath);
}
});
fs.rmdirSync(filePath);
} else {
fs.unlinkSync(filePath);
}
}
});
}