1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-08-27 02:54:27 +02:00

chore: upgrade dependencies (#8468)

* Upgrade paths

* Update topic rendering

* Fix file names

* Remove courses file
This commit is contained in:
Kamran Ahmed
2025-04-07 15:52:48 +01:00
committed by GitHub
parent 0d62847053
commit 82c52aca7e
1355 changed files with 449 additions and 802 deletions

58
scripts/rename-content.ts Normal file
View File

@@ -0,0 +1,58 @@
import fs from 'fs';
import path from 'path';
const roadmapDirs = fs.readdirSync(
path.join(__dirname, '..', 'src', 'data', 'roadmaps'),
);
roadmapDirs.forEach((roadmapDir) => {
const roadmapDirPath = path.join(
__dirname,
'..',
'src',
'data',
'roadmaps',
roadmapDir,
'content',
);
const roadmapDirContent = fs.readdirSync(roadmapDirPath);
roadmapDirContent.forEach((content) => {
const contentPath = path.join(roadmapDirPath, content);
const contentStats = fs.statSync(contentPath);
const oldName = path.basename(contentPath);
const newName = oldName.replace(/^(\d+)-/, '');
fs.renameSync(contentPath, path.join(roadmapDirPath, newName));
if (contentStats.isDirectory()) {
const contentDirContent = fs.readdirSync(contentPath);
contentDirContent.forEach((contentDir) => {
const contentDirPath = path.join(contentPath, contentDir);
const contentDirStats = fs.statSync(contentDirPath);
const oldName = path.basename(contentDirPath);
const newName = oldName.replace(/^(\d+)-/, '');
fs.renameSync(contentDirPath, path.join(contentPath, newName));
if (contentDirStats.isDirectory()) {
const contentDirContent = fs.readdirSync(contentDirPath);
contentDirContent.forEach((contentDir) => {
const contentDirPath2 = path.join(contentDirPath, contentDir);
const contentDirStats2 = fs.statSync(contentDirPath2);
const oldName2 = path.basename(contentDirPath2);
const newName2 = oldName2.replace(/^(\d+)-/, '');
fs.renameSync(contentDirPath2, path.join(contentDirPath, newName2));
});
}
});
}
});
});