Skip to content

Commit

Permalink
issue/49: cannot register name-part extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverfoster authored and danielstorey committed Aug 1, 2017
1 parent 1be78b4 commit f8f7861
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/commands/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,17 @@ function exists(plugin) {

function exactMatch(pattern) {
return function (item) {
var regexp = typeof pattern === 'string' ? new RegExp(pattern, 'i') : pattern;
if (typeof pattern === 'string') {
if (pattern.toLowerCase() === item.name.toLowerCase()) {
return true;
}
return false
}
var regexp = new RegExp(pattern, 'i');
return regexp.test(item.name);
};
}

function reportExistence(plugin, renderer) {
renderer.log(chalk.yellow(plugin.toString()), chalk.cyan('has been previously registered. Plugin names must be unique. Try again with a different name.'));
}
}

0 comments on commit f8f7861

Please sign in to comment.