Skip to content

Commit

Permalink
Fix --no-editorconfig option - Fix #253
Browse files Browse the repository at this point in the history
  • Loading branch information
SBoudrias committed Mar 23, 2017
1 parent 829a1fc commit 4810bef
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
8 changes: 8 additions & 0 deletions __tests__/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,12 @@ describe('node:app', function () {
});
});
});

describe('--no-editorconfig', function () {
it('include the raw files', function () {
return helpers.run(path.join(__dirname, '../generators/app'))
.withOptions({editorconfig: false})
.then(() => assert.noFile('.editorconfig'));
});
});
});
13 changes: 11 additions & 2 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ module.exports = Generator.extend({
desc: 'Include coveralls config'
});

this.option('editorconfig', {
type: Boolean,
required: false,
default: true,
desc: 'Include a .editorconfig file'
});

this.option('license', {
type: Boolean,
required: false,
Expand Down Expand Up @@ -226,9 +233,11 @@ module.exports = Generator.extend({
this.composeWith(require.resolve('generator-travis/generators/app'), options);
}

this.composeWith(require.resolve('../editorconfig'));
this.composeWith(require.resolve('../nsp'));
if (this.options.editorconfig) {
this.composeWith(require.resolve('../editorconfig'));
}

this.composeWith(require.resolve('../nsp'));
this.composeWith(require.resolve('../eslint'));

this.composeWith(require.resolve('../git'), {
Expand Down

0 comments on commit 4810bef

Please sign in to comment.