yeoman-environment
Advanced tools
Comparing version 1.6.3 to 1.6.4
@@ -233,16 +233,18 @@ 'use strict'; | ||
* | ||
* @param {String} namespace | ||
* @param {String} namespaceOrPath | ||
* @return {Generator|null} - the generator registered under the namespace | ||
*/ | ||
Environment.prototype.get = function get(namespace) { | ||
Environment.prototype.get = function get(namespaceOrPath) { | ||
// Stop the recursive search if nothing is left | ||
if (!namespace) { | ||
if (!namespaceOrPath) { | ||
return; | ||
} | ||
var namespace = namespaceOrPath; | ||
// Legacy yeoman-generator `#hookFor()` function is passing the generator path as part | ||
// of the namespace. If we find a path delimiter in the namespace, then ignore the | ||
// last part of the namespace. | ||
var parts = namespace.split(':'); | ||
var parts = namespaceOrPath.split(':'); | ||
var maybePath = _.last(parts); | ||
@@ -262,3 +264,5 @@ if (parts.length > 1 && /[\/\\]/.test(maybePath)) { | ||
this.store.get(this.alias(namespace)) || | ||
this.getByPath(namespace); | ||
// namespace is empty if namespaceOrPath contains a win32 absolute path of the form 'C:\path\to\generator'. | ||
// for this reason we pass namespaceOrPath to the getByPath function. | ||
this.getByPath(namespaceOrPath); | ||
}; | ||
@@ -265,0 +269,0 @@ |
{ | ||
"name": "yeoman-environment", | ||
"version": "1.6.3", | ||
"version": "1.6.4", | ||
"description": "Handles the lifecyle and bootstrapping of generators in a specific environment", | ||
@@ -5,0 +5,0 @@ "homepage": "http://yeoman.io", |
32628
916