Correct edge case with 'module' key

This commit is contained in:
Andrew Stewart 2015-02-19 12:44:35 -08:00
parent b0cb253987
commit 5ac95161e2
1 changed files with 7 additions and 6 deletions

View File

@ -19,14 +19,15 @@ function testMode() {
module.exports = function Initializer(type, opts) {
var mod;
if (opts.module) {
mod = Registry.register(opts.module);
} else {
mod = Registry.findBy(type, opts[type]);
}
mod = Registry.findBy(type, opts[type]);
if (!mod) {
Registry.register("cylon-" + opts[type]);
if (opts.module) {
Registry.register(opts.module);
} else {
Registry.register("cylon-" + opts[type]);
}
mod = Registry.findBy(type, opts[type]);
}