1 | const fs = require('fs');
|
2 | const Path = require('path');
|
3 |
|
4 | const pathsToClean = [
|
5 | Path.resolve('./node_modules/bitcore-ecies/node_modules/bitcore-lib'),
|
6 | Path.resolve('./node_modules/bitcore-message/node_modules/bitcore-lib'),
|
7 | Path.resolve('./node_modules/bitcore-mnemonic/node_modules/bitcore-lib'),
|
8 |
|
9 | ];
|
10 |
|
11 | (function() {
|
12 | function deleteFolderRecursive(path) {
|
13 | if (fs.existsSync(path)) {
|
14 | fs.readdirSync(path).forEach(function(file, index) {
|
15 | const curPath = path + "/" + file;
|
16 | if (fs.lstatSync(curPath).isDirectory()) {
|
17 | deleteFolderRecursive(curPath);
|
18 | } else {
|
19 | fs.unlinkSync(curPath);
|
20 | }
|
21 | });
|
22 | fs.rmdirSync(path);
|
23 | }
|
24 | }
|
25 |
|
26 | for (let path of pathsToClean) {
|
27 | deleteFolderRecursive(path);
|
28 | }
|
29 | })(); |
\ | No newline at end of file |