Skip to content

Commit

Permalink
Add .vscode/settings.json
Browse files Browse the repository at this point in the history
Also make quit more explicit.
Pass tests
  • Loading branch information
unional committed Feb 19, 2016
1 parent 33068c5 commit a72f908
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ module.exports = yeoman.generators.Base.extend({
when: () => folder !== this.packageName
}, (props) => {
console.log('quit', props.quit);
if (props.quit) {
if (props.quit === 'Y') {
this.log('');
this.log(`Please create your repo and run ${chalk.green('yo typings') } again.`);
process.exit(1);
Expand Down Expand Up @@ -128,6 +128,10 @@ module.exports = yeoman.generators.Base.extend({

writing: {
copyFiles() {
this.fs.copy(
this.templatePath('.vscode/*'),
this.destinationPath('.vscode')
);
this.fs.copy(
this.templatePath('test/*'),
this.destinationPath('test')
Expand Down
3 changes: 3 additions & 0 deletions generators/app/templates/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
2 changes: 2 additions & 0 deletions test/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ describe('generator-typings:app', function () {
helpers.run(path.join(__dirname, '../generators/app'))
.withPrompts({
sourceUri: 'facebook/reactDOM',
quit: 'n',
packageName: 'typed-reactDOM',
username: 'unional'
})
Expand All @@ -17,6 +18,7 @@ describe('generator-typings:app', function () {

it('creates files', function () {
assert.file([
'.vscode/settings.json',
'test/test.ts',
'test/tsconfig.json',
'.editorconfig',
Expand Down

0 comments on commit a72f908

Please sign in to comment.