-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprepare.mjs
More file actions
executable file
·31 lines (28 loc) · 915 Bytes
/
prepare.mjs
File metadata and controls
executable file
·31 lines (28 loc) · 915 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
26
27
28
29
30
31
import { existsSync, readdirSync, lstatSync, unlinkSync, rmdirSync } from 'fs';
import { join } from 'path';
const deleteFolderRecursive = (directoryPath) => {
if (existsSync(directoryPath)) {
readdirSync(directoryPath).forEach((file) => {
const curPath = join(directoryPath, file);
if (lstatSync(curPath).isDirectory()) {
deleteFolderRecursive(curPath);
} else {
unlinkSync(curPath);
}
});
rmdirSync(directoryPath);
}
};
const directoriesToDelete = [
'scaffolds/csharp/bin',
'scaffolds/csharp/obj',
'scaffolds/seleniumCsharp/bin',
'scaffolds/seleniumCsharp/obj',
'scaffolds/playwrightCsharp/bin',
'scaffolds/playwrightCsharp/obj',
'scaffolds/seleniumJava/target',
'scaffolds/java/target',
];
directoriesToDelete.forEach((dir) => {
deleteFolderRecursive(dir);
});