forked from graphieros/vue-data-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcleanup.cjs
More file actions
25 lines (20 loc) · 796 Bytes
/
cleanup.cjs
File metadata and controls
25 lines (20 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const fs = require("fs");
const path = require("path");
const currentDir = path.dirname(require.main.filename);
function deleteFolderRecursive(path) {
if (fs.existsSync(path) && fs.lstatSync(path).isDirectory()) {
fs.readdirSync(path).forEach(function (file, index) {
let curPath = path + "/" + file;
if (fs.lstatSync(curPath).isDirectory()) { // recurse
deleteFolderRecursive(curPath);
} else { // delete file
fs.unlinkSync(curPath);
}
});
console.log(`Deleting directory "${path}"...`);
fs.rmdirSync(path);
}
}
deleteFolderRecursive(`${currentDir}\\node_modules\\vue-data-ui`);
deleteFolderRecursive(`${currentDir}\\node_modules\\.vite`);
deleteFolderRecursive('dist');