From 2ff0754a88b681068410882be30927197b12b47b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20K=C3=BChnel?= Date: Fri, 9 Dec 2016 00:21:44 +0100 Subject: [PATCH] Change handling argument for generator name --- app/index.js | 2 +- subgenerator/index.js | 4 ++-- test/subgenerator.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/index.js b/app/index.js index 7e436a69..a3dd6ebb 100644 --- a/app/index.js +++ b/app/index.js @@ -56,7 +56,7 @@ module.exports = class extends Generator { }); this.composeWith(require.resolve('../subgenerator'), { - name: 'app' + arguments: ['app'] }); } diff --git a/subgenerator/index.js b/subgenerator/index.js index fffba9e3..f1ee5d63 100644 --- a/subgenerator/index.js +++ b/subgenerator/index.js @@ -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' }); } diff --git a/test/subgenerator.js b/test/subgenerator.js index 25405fe2..6374300e 100644 --- a/test/subgenerator.js +++ b/test/subgenerator.js @@ -17,8 +17,8 @@ describe('generator:subgenerator', () => { }); return helpers.run(path.join(__dirname, '../subgenerator')) + .withArguments(['foo']) .withOptions({ - name: 'foo', force: true }) .inTmpDir(tmpDir => {