-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrmm.js
30 lines (25 loc) · 807 Bytes
/
rmm.js
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
const fs = require('fs');
const path = require('path');
function deleteJsFiles(folderPath) {
// Read the contents of the folder
const files = fs.readdirSync(folderPath);
// Loop through each file
files.forEach((file) => {
const filePath = path.join(folderPath, file);
// Check if it's a directory
if (fs.statSync(filePath).isDirectory()) {
// If it's a directory, recursively call deleteJsFiles
deleteJsFiles(filePath);
} else {
// If it's a file and has a .js extension, delete it
if (filePath.endsWith('.d.ts')) {
fs.unlinkSync(filePath);
console.log(`Deleted: ${filePath}`);
}
}
});
}
// Specify the root folder path
const rootFolderPath = './client';
// Call the function to delete JS files
deleteJsFiles(rootFolderPath);