diff --git a/projects/next-js/advanced/attendance-tracking-app/app/(root)/(home)/page.tsx b/projects/next-js/advanced/attendance-tracking-app/app/root/(home)/page.tsx similarity index 100% rename from projects/next-js/advanced/attendance-tracking-app/app/(root)/(home)/page.tsx rename to projects/next-js/advanced/attendance-tracking-app/app/root/(home)/page.tsx diff --git a/projects/next-js/advanced/attendance-tracking-app/app/(root)/calendar/page.tsx b/projects/next-js/advanced/attendance-tracking-app/app/root/calendar/page.tsx similarity index 100% rename from projects/next-js/advanced/attendance-tracking-app/app/(root)/calendar/page.tsx rename to projects/next-js/advanced/attendance-tracking-app/app/root/calendar/page.tsx diff --git a/projects/next-js/advanced/attendance-tracking-app/app/(root)/layout.tsx b/projects/next-js/advanced/attendance-tracking-app/app/root/layout.tsx similarity index 100% rename from projects/next-js/advanced/attendance-tracking-app/app/(root)/layout.tsx rename to projects/next-js/advanced/attendance-tracking-app/app/root/layout.tsx diff --git a/projects/next-js/advanced/attendance-tracking-app/app/(root)/settings/dsa/page.tsx b/projects/next-js/advanced/attendance-tracking-app/app/root/settings/dsa/page.tsx similarity index 100% rename from projects/next-js/advanced/attendance-tracking-app/app/(root)/settings/dsa/page.tsx rename to projects/next-js/advanced/attendance-tracking-app/app/root/settings/dsa/page.tsx diff --git a/projects/next-js/advanced/attendance-tracking-app/app/(root)/settings/layout.tsx b/projects/next-js/advanced/attendance-tracking-app/app/root/settings/layout.tsx similarity index 100% rename from projects/next-js/advanced/attendance-tracking-app/app/(root)/settings/layout.tsx rename to projects/next-js/advanced/attendance-tracking-app/app/root/settings/layout.tsx diff --git a/projects/next-js/advanced/attendance-tracking-app/app/(root)/settings/page.tsx b/projects/next-js/advanced/attendance-tracking-app/app/root/settings/page.tsx similarity index 100% rename from projects/next-js/advanced/attendance-tracking-app/app/(root)/settings/page.tsx rename to projects/next-js/advanced/attendance-tracking-app/app/root/settings/page.tsx diff --git a/projects/vanilla-js/advanced/Audio-Analyzer/README.md b/projects/vanilla-js/advanced/Audio-Analyzer/README.md index c30e38cd..a8b8515b 100644 --- a/projects/vanilla-js/advanced/Audio-Analyzer/README.md +++ b/projects/vanilla-js/advanced/Audio-Analyzer/README.md @@ -10,7 +10,6 @@ ![HTML5](https://img.shields.io/badge/html5-%23E34F26.svg?style=for-the-badge&logo=html5&logoColor=white) ![CSS3](https://img.shields.io/badge/css3-%231572B6.svg?style=for-the-badge&logo=css3&logoColor=white) ![JavaScript](https://img.shields.io/badge/javascript-%23323330.svg?style=for-the-badge&logo=javascript&logoColor=%23F7DF1E) - diff --git a/renameFolders.js b/renameFolders.js new file mode 100644 index 00000000..8289e84a --- /dev/null +++ b/renameFolders.js @@ -0,0 +1,38 @@ +import fs from 'fs'; +import path from 'path'; + +const baseDir = './projects/'; // Adjust this to your base directory + +const toValidProjectName = (name) => { + return name + .toLowerCase() + .replace(/[^a-z0-9._-]/g, '-') + .replace(/-{2,}/g, '-') + .replace(/^-+|-+$/g, ''); +}; + +const renameDirectories = (dir) => { + fs.readdir(dir, (err, files) => { + if (err) throw err; + + files.forEach((file) => { + const currentPath = path.join(dir, file); + const newName = toValidProjectName(file); + const newPath = path.join(dir, newName); + + if (fs.statSync(currentPath).isDirectory()) { + if (newPath !== currentPath) { + fs.rename(currentPath, newPath, (err) => { + if (err) throw err; + console.log(`Renamed: ${currentPath} to ${newPath}`); + }); + } + // Recursively rename inside subdirectories + renameDirectories(newPath); + } + }); + }); +}; + +// Start renaming from the base directory +renameDirectories(baseDir);