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

Commit

Permalink
fix: force set plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Feb 7, 2018
1 parent 94e2b7c commit 0f0de6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ export namespace Command {
load(): Class
}

export function toCached(c: Class): Command {
export function toCached(c: Class, plugin: Config.Plugin): Command {
return {
id: c.id,
description: c.description,
usage: c.usage,
pluginName: c.plugin && c.plugin.name,
pluginType: c.plugin && c.plugin.type,
pluginName: plugin.name,
pluginType: plugin.type,
hidden: c.hidden,
aliases: c.aliases || [],
examples: c.examples,
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export class Plugin implements IPlugin {
version: this.version,
commands: this.commandIDs.map(id => {
try {
return [id, Command.toCached(this.findCommand(id, {must: true}))]
return [id, Command.toCached(this.findCommand(id, {must: true}), this)]
} catch (err) { this.warn(err, 'toCached') }
})
.filter((f): f is [string, Command] => !!f)
Expand Down

0 comments on commit 0f0de6c

Please sign in to comment.