Skip to content

Commit 55ef64f

Browse files
author
Evan Jacobs
committed
Fix a yosay bug
The prompts were showing up in the middle of the yosay speech bubble for some reason.
1 parent e710eaf commit 55ef64f

File tree

1 file changed

+39
-35
lines changed

1 file changed

+39
-35
lines changed

generators/app/index.js

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -42,41 +42,44 @@ module.exports = yeoman.Base.extend({
4242
chalk.gray('You\'re 4 questions from a fully-functional React app, built with best practice enforcement, integrated testing, and more.')
4343
].join('\n')));
4444

45-
var prompts = [{
46-
type: 'input',
47-
name: 'appName',
48-
message: formatPrompt([
49-
chalk.bold.white('What should this webapp be called?'),
50-
chalk.gray(' This should conform to the npm "kebab-case" naming, e.g. google-maps')
51-
]),
52-
}, {
53-
type: 'input',
54-
name: 'appDescription',
55-
message: formatPrompt([
56-
chalk.bold.white('What will the app be used for?'),
57-
chalk.gray(' A one-liner - the elevator pitch!')
58-
])
59-
}, {
60-
type: 'input',
61-
name: 'authorName',
62-
message: formatPrompt(chalk.bold.white('What is your first and last name?')),
63-
default: this.user.git.name()
64-
}, {
65-
type: 'input',
66-
name: 'authorEmail',
67-
message: formatPrompt(chalk.bold.white('What is your email?')),
68-
default: this.user.git.email()
69-
}];
70-
71-
this.prompt(prompts, function(answers) {
72-
this.answers = answers;
73-
this.answers.appName = _.kebabCase(this.answers.appName);
74-
75-
this.answers.currentDate = (new Date()).toLocaleDateString();
76-
this.answers.currentYear = (new Date()).getFullYear();
77-
78-
done();
79-
}.bind(this));
45+
// fix yosay doing weird stuff in Node 6+
46+
setTimeout(() => {
47+
var prompts = [{
48+
type: 'input',
49+
name: 'appName',
50+
message: formatPrompt([
51+
chalk.bold.white('What should this webapp be called?'),
52+
chalk.gray(' This should conform to the npm "kebab-case" naming, e.g. google-maps')
53+
]),
54+
}, {
55+
type: 'input',
56+
name: 'appDescription',
57+
message: formatPrompt([
58+
chalk.bold.white('What will the app be used for?'),
59+
chalk.gray(' A one-liner - the elevator pitch!')
60+
])
61+
}, {
62+
type: 'input',
63+
name: 'authorName',
64+
message: formatPrompt(chalk.bold.white('What is your first and last name?')),
65+
default: this.user.git.name()
66+
}, {
67+
type: 'input',
68+
name: 'authorEmail',
69+
message: formatPrompt(chalk.bold.white('What is your email?')),
70+
default: this.user.git.email()
71+
}];
72+
73+
this.prompt(prompts, function(answers) {
74+
this.answers = answers;
75+
this.answers.appName = _.kebabCase(this.answers.appName);
76+
77+
this.answers.currentDate = (new Date()).toLocaleDateString();
78+
this.answers.currentYear = (new Date()).getFullYear();
79+
80+
done();
81+
}.bind(this));
82+
}, 0);
8083
},
8184

8285
writing: function() {
@@ -92,6 +95,7 @@ module.exports = yeoman.Base.extend({
9295
['_eslintrc', '.eslintrc'],
9396
['_gitignore', '.gitignore'],
9497
'CONTRIBUTING.md',
98+
'scripts/budo.js',
9599
'scripts/parallelize.sh',
96100
'src/example/index.js',
97101
'src/example/style.styl',

0 commit comments

Comments
 (0)