Skip to content

Commit

Permalink
✨ feat(about): display amount of badges currently available
Browse files Browse the repository at this point in the history
inttter committed Feb 25, 2024
1 parent bb6563c commit c068082
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -465,7 +465,7 @@ program
});

// About/Info Command
program
program
.command('about')
.alias('abt')
.description('display general information about the package')
@@ -475,6 +475,12 @@ program
const response = await axios.get(`https://registry.npmjs.org/mdbadges-cli`);
const latestVersion = response.data["dist-tags"].latest;

// counts the number of badges and saves it in numOfBadges
let numOfBadges = 0;
Object.values(badges).forEach(category => {
numOfBadges += Object.keys(category).length;
});

console.log();
console.log(c.green.bold(' _ _ _ _ _ '));
console.log(c.green.bold(' | || | | | | |(_) '));
@@ -494,6 +500,8 @@ program
console.log(c.yellow(`${c.yellow.bold.underline('Your Version:')} ${userPackageVersion}`));
console.log(c.blue(`If these versions do not match, run ${c.cyan.bold('mdb update')}.`));
console.log();
console.log(c.yellow(`Badges Available: ${numOfBadges}`));
consola.log();
console.log(c.blue(`• ${c.cyan.bold('mdb help')} to view the available list of commands`));
console.log(c.blue(`• ${c.cyan.bold('mdb changelog')} to view the latest release`));
console.log(c.blue(`• ${c.cyan.bold('mdb docs')} to view the documentation`))

0 comments on commit c068082

Please sign in to comment.