Skip to content

Commit e6958c3

Browse files
committed
🛀 Clean up and regenerate README
1 parent 55a2e64 commit e6958c3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2260
-6654
lines changed

‎README.md

+154-48
Large diffs are not rendered by default.

‎episode_000/generate.js

+19-5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@ const { promises: fs } = require('fs');
22
const axios = require('axios');
33
const { items: videos } = require('./videos.json');
44

5+
const ignoreFiles = {
6+
'README.md': true,
7+
'.vscode': true,
8+
'node_modules': true,
9+
'.eslintrc.js': true,
10+
'package.json': true,
11+
'package-lock.json': true,
12+
'example.js': true,
13+
'scratch.js': true,
14+
};
15+
516
(async () => {
617
const katas = [];
718
let tableOfContents = `# Code Katas
@@ -13,9 +24,11 @@ Search / Filter solutions [here](https://code-katas.now.sh/)
1324
`;
1425
const files = await fs.readdir('../', 'utf8');
1526
files.reverse();
16-
for (const directory of files) {
27+
let episodeCount = 0;
28+
for (let i = 0; i < files.length; i++) {
29+
const directory = files[i];
1730
if (directory.startsWith('episode') && directory !== 'episode_000') {
18-
const episodeNum = +directory.replace('episode_', '');
31+
const episodeNum = directory.replace('episode_', '');
1932
const solutions = await fs.readdir(`../${directory}`, 'utf8');
2033

2134
const {
@@ -24,7 +37,8 @@ Search / Filter solutions [here](https://code-katas.now.sh/)
2437
videoId
2538
}
2639
}
27-
} = videos[episodeNum - 1];
40+
} = videos[episodeCount];
41+
episodeCount++;
2842

2943
const video = `https://www.youtube.com/watch?v=${videoId}`;
3044

@@ -36,7 +50,7 @@ Search / Filter solutions [here](https://code-katas.now.sh/)
3650
`
3751
const episodeKatas = [];
3852
for (const name of solutions) {
39-
if (name.endsWith('.js')) {
53+
if (!ignoreFiles[name]) {
4054
const slug = name.replace('.js', '');
4155
const githubUrl = `https://github.com/CodingGarden/code-katas/blob/master/${directory}/${name}`;
4256
try {
@@ -56,7 +70,7 @@ Search / Filter solutions [here](https://code-katas.now.sh/)
5670
}
5771
});
5872
} catch (error) {
59-
console.log(slug, 'not found...')
73+
console.log(slug, 'not found...');
6074
}
6175
}
6276
}

0 commit comments

Comments
 (0)