Skip to content

Commit

Permalink
UpdateTemplate should return promise (#84)
Browse files Browse the repository at this point in the history
Fix issue as it mix with normal flow
  • Loading branch information
unional committed Jun 3, 2016
1 parent e2d93d4 commit 851889a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions generators/beta/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,6 @@ module.exports = yeoman.Base.extend({
},
greeting() {
this.log(yosay(`Welcome to the sensational ${chalk.yellow('typings')} generator!`));
this.log('');
this.log(`I'll be creating the ${chalk.yellow('typings')} repository under the ${chalk.cyan(this.typingsName ? this.typingsName : 'current')} folder`);
},
waitForLocalInfo() {
const done = this.async();
Expand All @@ -244,22 +242,24 @@ module.exports = yeoman.Base.extend({

if (this.options.updateTemplate) {
this.log(`You want to update your ${chalk.green('template')}? Here it goes...`);
this.updateConfigTemplate();
return this.updateConfigTemplate();
}
else if (typeof this.configTemplate.version === 'undefined') {
this.log(`Seems like this is the ${chalk.cyan('first time')} you use this generator.`);
this.log(`Let's quickly setup the ${chalk.green('template')}...`);

this.updateConfigTemplate();
return this.updateConfigTemplate();
}
else if (this.configTemplate.version !== TEMPLATEVERSION) {
this.log(`Seems like you have ${chalk.cyan('updated')} this generator. The template has changed.`);
this.log(`Let's quickly update the ${chalk.green('template')}...`);

this.updateConfigTemplate();
return this.updateConfigTemplate();
}
},
enterSourceSection() {
this.log('');
this.log(`I'll be creating the ${chalk.yellow('typings')} repository under the ${chalk.cyan(this.typingsName ? this.typingsName : 'current')} folder`);
this.log('');
this.log(`To begin, I need to know a little bit about the ${chalk.green('source')} you are typings for.`);
},
Expand Down

0 comments on commit 851889a

Please sign in to comment.