Skip to content

Commit

Permalink
Merge bbc2cdb into ed138c6
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Oct 1, 2019
2 parents ed138c6 + bbc2cdb commit 37e762e
Show file tree
Hide file tree
Showing 3 changed files with 398 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/index.js
Expand Up @@ -504,7 +504,7 @@ class Generator extends EventEmitter {

/**
* Compose this generator with another one.
* @param {String|Object} generator The path to the generator module or an object (see examples)
* @param {String|Object|Array} generator The path to the generator module or an object (see examples)
* @param {Object} options The options passed to the Generator
* @return {this} This generator
*
Expand All @@ -520,6 +520,13 @@ class Generator extends EventEmitter {
composeWith(generator, options) {
let instantiatedGenerator;

if (_.isArray(generator)) {
generator.forEach(gen => {
this.composeWith(gen, options);
});
return this;
}

const instantiate = (Generator, path) => {
Generator.resolved = require.resolve(path);
Generator.namespace = this.env.namespace(path);
Expand Down

0 comments on commit 37e762e

Please sign in to comment.