Skip to content

Commit

Permalink
fix(app): fix github username calculation throwing an error
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Van Camp committed Jul 11, 2018
1 parent 938b8ef commit 037961d
Show file tree
Hide file tree
Showing 4 changed files with 239 additions and 120 deletions.
19 changes: 10 additions & 9 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,20 @@ module.exports = Generator.extend({
askForGithubAccount() {
const done = this.async();

githubUsername(this.props.authorEmail, (err, username) => {
if (err) {
username = username || '';
}

this.prompt({
let username = '';
githubUsername(this.props.authorEmail).then(un => {
username = un;
}).catch(() => {
// Do nothing.
}).then(() => {
return this.prompt({
name: 'githubAccount',
message: 'GitHub username or organization',
default: username
}).then(prompt => {
this.props.githubAccount = prompt.githubAccount;
done();
});
}).then(prompt => {
this.props.githubAccount = prompt.githubAccount;
done();
});
}
},
Expand Down
Loading

0 comments on commit 037961d

Please sign in to comment.