Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
fix: sort commands by id
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jun 15, 2018
1 parent 09bba29 commit 8245d9c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ export class Plugin implements IPlugin {
this.manifest = await this._manifest(!!this.options.ignoreManifest, !!this.options.errorOnManifestCreate)
this.commands = Object.entries(this.manifest.commands)
.map(([id, c]) => ({...c, load: () => this.findCommand(id, {must: true})}))
this.commands.sort((a, b) => {
if (a.id < b.id) return -1
if (a.id > b.id) return 1
return 0
})
}

get topics(): Topic[] { return topicsToArray(this.pjson.oclif.topics || {}) }
Expand Down

0 comments on commit 8245d9c

Please sign in to comment.