Skip to content

Commit

Permalink
Correct edge case with 'module' key
Browse files Browse the repository at this point in the history
  • Loading branch information
stewart committed Feb 19, 2015
1 parent b0cb253 commit 5ac9516
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/initializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}

Expand Down

0 comments on commit 5ac9516

Please sign in to comment.