Skip to content

Commit

Permalink
Handle failing github-username properly
Browse files Browse the repository at this point in the history
  • Loading branch information
SBoudrias committed Oct 18, 2016
1 parent 2a0d11c commit efe25b9
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,18 +184,21 @@ module.exports = generators.Base.extend({
return;
}

return githubUsername(this.props.authorEmail).then(function (err, username) {
if (err) {
username = username || '';
}
return this.prompt({
name: 'githubAccount',
message: 'GitHub username or organization',
default: username
}).then(function (prompt) {
this.props.githubAccount = prompt.githubAccount;
return githubUsername(this.props.authorEmail)
.then(function (username) {
return username;
}, function () {
return '';
})
.then(function (username) {
return this.prompt({
name: 'githubAccount',
message: 'GitHub username or organization',
default: username
}).then(function (prompt) {
this.props.githubAccount = prompt.githubAccount;
}.bind(this));
}.bind(this));
}.bind(this));
}
},

Expand Down

0 comments on commit efe25b9

Please sign in to comment.