This commit is contained in:
“kyro3400” committed 2024-11-17 22:55:16 +00:00
1 parent 9b8ea8856e
commit 8bef93cfba
34 files changed
+29

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
const fs = require("fs");
const path = require("path");
const directoryPath = path.join(__dirname, "domains");
(async () => {
try {
// Read the files in the 'domains' directory
const files = await fs.promises.readdir(directoryPath);
let renamedCount = 0;
for (const file of files) {
const oldPath = path.join(directoryPath, file);
const newPath = path.join(directoryPath, file.toLowerCase());
// Only rename if the file name is not already in lowercase
if (oldPath !== newPath) {
await fs.promises.rename(oldPath, newPath);
console.log(`Renamed: ${file} -> ${file.toLowerCase()}`);
renamedCount++;
}
}
console.log(`Finished! Renamed ${renamedCount} out of ${files.length} files.`);
} catch (err) {
console.error("Error:", err);
}
})();
File renamed without changes.
File renamed without changes.
File renamed without changes.