Skip to content

Commit

Permalink
Fix composeWith to allow passing explicit arguments for yeoman-genera…
Browse files Browse the repository at this point in the history
…tor@<1.0
  • Loading branch information
SBoudrias committed Dec 8, 2016
1 parent 9aa4e02 commit df7012f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,16 @@ Base.prototype.composeWith = function composeWith(modulePath, options) {
var Generator = require(modulePath);
Generator.resolved = require.resolve(modulePath);
Generator.namespace = this.env.namespace(modulePath);
generator = this.env.instantiate(Generator, {options: options});
generator = this.env.instantiate(Generator, {
options: options,
arguments: options.arguments
});
} catch (err) {
if (err.code === 'MODULE_NOT_FOUND') {
generator = this.env.create(modulePath, {options: options});
generator = this.env.create(modulePath, {
options: options,
arguments: options.arguments
});
} else {
throw err;
}
Expand Down

1 comment on commit df7012f

@mischah
Copy link
Member

@mischah mischah commented on df7012f Dec 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

Please sign in to comment.