Skip to content

Commit

Permalink
feat: add versions to output versions of AsyncAPI tools used (async…
Browse files Browse the repository at this point in the history
  • Loading branch information
aeworxet committed May 10, 2023
1 parent 94698d9 commit 6f1769f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/commands/config/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class Versions extends Command {
async run() {
// Preparation of the array with all dependencies '@asyncapi/*' along with
// their versions.
for (let key in this.config.pjson.dependencies) {
for (const key in this.config.pjson.dependencies) {
// Making sure with .indexOf() that only package names which START with
// string '@asyncapi' are considered.
if (key.indexOf('@asyncapi', 0) === 0) {
Expand All @@ -24,12 +24,10 @@ export default class Versions extends Command {
// Goofy name `importedPJSON` is chosen to distinguish from name `pjson`
// used in `@oclif` source code.
const importedPJSON = await import(key + '/package.json');
key = key + '/' + importedPJSON.default.version;
this.dependencies.push(key + '/' + importedPJSON.default.version);
} catch (e) {
key = key + '/' + '`package.json` not found';
this.dependencies.push(key + '/' + '`package.json` not found');
}

this.dependencies.push(key);
}
}

Expand Down

0 comments on commit 6f1769f

Please sign in to comment.