Skip to content

Commit 62a5a12

Browse files
committed
refactor: pretifier generator code
1 parent 9de2d32 commit 62a5a12

File tree

1 file changed

+19
-22
lines changed

1 file changed

+19
-22
lines changed

generators/app/index.js

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
11
const Generator = require('yeoman-generator');
2-
const chalk = require("chalk");
3-
const yosay = require("yosay");
2+
const chalk = require('chalk');
3+
const yosay = require('yosay');
4+
45
const pkg = require('../../package.json');
56

67
module.exports = class extends Generator {
78
async prompting() {
89
this.log(
9-
yosay(
10-
`Welcome to the astounding ${chalk.red(pkg.name)} generator!`
11-
)
10+
yosay(`Welcome to the astounding ${chalk.red(pkg.name)} generator!`),
1211
);
13-
12+
1413
const prompts = [
1514
{
16-
type: "input",
17-
name: "elementName",
18-
message: "What is the name of your package?",
19-
default: "my-awesome-package"
15+
type: 'input',
16+
name: 'elementName',
17+
message: 'What is the name of your package?',
18+
default: 'my-awesome-package',
2019
},
2120
{
22-
type: "input",
23-
name: "elementDescription",
24-
message: "Give us some small description of your package",
25-
default: ""
21+
type: 'input',
22+
name: 'elementDescription',
23+
message: 'Give us some small description of your package',
24+
default: '',
2625
},
2726
{
28-
type: "input",
29-
name: "elementAuthor",
30-
message: "Who is the author of this package?",
31-
default: ""
27+
type: 'input',
28+
name: 'elementAuthor',
29+
message: 'Who is the author of this package?',
30+
default: '',
3231
},
3332
];
3433

@@ -40,15 +39,13 @@ module.exports = class extends Generator {
4039

4140
writing() {
4241
this.fs.copyTpl(
43-
[
44-
this.templatePath('**'),
45-
],
42+
[this.templatePath('**')],
4643
this.destinationPath(),
4744
this.props,
4845
);
4946
}
5047

51-
install () {
48+
install() {
5249
this.installDependencies();
5350
}
5451
};

0 commit comments

Comments
 (0)