mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-10-13 00:14:42 +00:00
Delete scripts directory
This commit is contained in:
1 parent
074b7e2aae
commit
58f3d5b920
1 file changed
-32
@@ -1,32 +0,0 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const directoryPath = path.join(__dirname, "../domains");
|
||||
|
||||
function renameFilesToLowercase() {
|
||||
// Read the files in the 'domains' directory
|
||||
fs.readdir(directoryPath, (err, files) => {
|
||||
if (err) {
|
||||
console.error("Error reading directory:", err);
|
||||
return;
|
||||
}
|
||||
|
||||
files.forEach((file) => {
|
||||
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) {
|
||||
fs.rename(oldPath, newPath, (err) => {
|
||||
if (err) {
|
||||
console.error("Error renaming file:", err);
|
||||
} else {
|
||||
console.log(`Renamed: ${file} -> ${file.toLowerCase()}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
renameFilesToLowercase();
|
||||
Reference in new issue
Block a user