From f8f7861f71a76f6bc14a1b4278431020d9c151a1 Mon Sep 17 00:00:00 2001 From: Oliver Foster Date: Mon, 22 Feb 2016 16:06:08 +0000 Subject: [PATCH] issue/49: cannot register name-part extensions #49 --- lib/commands/register.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/commands/register.js b/lib/commands/register.js index c5918fe..80d1e7a 100644 --- a/lib/commands/register.js +++ b/lib/commands/register.js @@ -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.')); -} \ No newline at end of file +}