Skip to content

Commit

Permalink
Change handling argument for generator name
Browse files Browse the repository at this point in the history
  • Loading branch information
mischah committed Dec 8, 2016
1 parent cf7aee5 commit 2ff0754
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module.exports = class extends Generator {
});

this.composeWith(require.resolve('../subgenerator'), {
name: 'app'
arguments: ['app']
});
}

Expand Down
4 changes: 2 additions & 2 deletions subgenerator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ module.exports = class extends Generator {
constructor(args, opts) {
super(args, opts);

this.option('name', {
this.argument('name', {
type: String,
required: true,
desc: 'Generator name'
description: 'Generator name'
});
}

Expand Down
2 changes: 1 addition & 1 deletion test/subgenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ describe('generator:subgenerator', () => {
});

return helpers.run(path.join(__dirname, '../subgenerator'))
.withArguments(['foo'])
.withOptions({
name: 'foo',
force: true
})
.inTmpDir(tmpDir => {
Expand Down

0 comments on commit 2ff0754

Please sign in to comment.