Skip to content

Commit

Permalink
Merge pull request #97 from StackStorm/hotfix/duplicate-help
Browse files Browse the repository at this point in the history
Hotfix: avoid duplicating help entries
  • Loading branch information
emedvedev committed Mar 7, 2016
2 parents a0e1583 + 13916fd commit b9e7abc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/command_factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ CommandFactory.prototype.addCommand = function(command, name, format, action_ali
compiled_template = _.template('hubot ${command}');
command_string = compiled_template(context);

if (!flag || flag === utils.DISPLAY) {
this.robot.commands.push(command_string);
}
if (!flag || flag === utils.REPRESENTATION) {
this.st2_hubot_commands.push(command_string);
this.st2_commands_name_map[name] = action_alias;
this.st2_commands_format_map[format] = action_alias;
regex = this.getRegexForFormatString(format);
this.st2_commands_regex_map[format] = regex;
}
if ((!flag || flag === utils.DISPLAY) && this.robot.commands.indexOf(command_string) === -1) {
this.robot.commands.push(command_string);
}

this.robot.logger.debug('Added command: ' + command);
};
Expand Down

0 comments on commit b9e7abc

Please sign in to comment.