Skip to content

Commit 65f0cd2

Browse files
committed
Load roles
1 parent a4b096a commit 65f0cd2

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

.github/src/skills.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,26 +171,40 @@ const getSkills = (data, file) => {
171171
};
172172

173173
const analise = async (section) => {
174+
console.log(concolor`\nCheck: ${section}(b,white)`);
174175
const file = `Skills/${section}.md`;
175176
const md = await loadFile(file);
176177
const skills = getSkills(md, file);
177178
console.log(concolor.info(`Skills: ${skills.length}`));
178-
return;
179+
};
180+
181+
const match = async (role) => {
182+
console.log(concolor`\nRoles: ${role}(b,white)`);
183+
const file = `.github/src/Roles/${role}.md`;
184+
const md = await loadFile(file);
185+
console.log(concolor.info(`Size: ${md.length}`));
179186
};
180187

181188
(async () => {
182189
console.log(concolor.white(TITLE));
183190
console.log(concolor.info('Auto Checker'));
184191

185-
const files = await fs.readdir(`${PATH}/Skills/`);
186-
const sections = files
192+
const skillFiles = await fs.readdir(`${PATH}/Skills/`);
193+
const sections = skillFiles
187194
.filter((file) => file.endsWith('.md'))
188195
.map((file) => file.substring(0, file.length - '.md'.length));
189196
for (const section of sections) {
190-
console.log(concolor`\nCheck: ${section}(b,white)`);
191197
await analise(section);
192198
}
193199

200+
const roleFiles = await fs.readdir(`${PATH}/.github/src/Roles/`);
201+
const roles = roleFiles
202+
.filter((file) => file.endsWith('.md'))
203+
.map((file) => file.substring(0, file.length - '.md'.length));
204+
for (const role of roles) {
205+
await match(role);
206+
}
207+
194208
const badgeCode = codeBlock(BADGE);
195209

196210
const report = `## ${TITLE}\n\n${BADGE}\n\n${badgeCode}\n`;

0 commit comments

Comments
 (0)