Skip to content

Commit

Permalink
Merge 67a2888 into d023ead
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiemonge committed Jan 16, 2014
2 parents d023ead + 67a2888 commit 4248c34
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/env/resolver.js
Expand Up @@ -60,7 +60,7 @@ resolver.findGeneratorsIn = function (searchPaths) {
searchPaths.forEach(function (root) {
if (!root) return;
var found = glob.sync('generator-*', { cwd: root, stat: true }).map(function (match) {
return fs.realpathSync(path.join(root, match));
return path.join(root, match);
});
modules = found.concat(modules);
});
Expand All @@ -74,9 +74,16 @@ resolver.findGeneratorsIn = function (searchPaths) {
*/

resolver._tryRegistering = function (generatorReference) {
var namespace;
var path = fs.realpathSync(generatorReference);
try {
debug('found %s, trying to register', generatorReference);
this.register(generatorReference);

if (path !== generatorReference) {
namespace = this.namespace(generatorReference);
}

this.register(path, namespace);
} catch (e) {
console.error('Unable to register %s (Error: %s)', generatorReference, e.message);
}
Expand Down

0 comments on commit 4248c34

Please sign in to comment.