-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
45 lines (42 loc) · 1.38 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env node
const inquirer = require('inquirer');
const steps = {
clone: require('./steps/clone'),
composer: require('./steps/composer'),
registration: require('./steps/registration'),
theme: require('./steps/theme'),
init: require('./steps/init'),
preview: require('./steps/preview'),
};
inquirer
.prompt([
{
type: 'input',
name: 'name',
message:
'What is the name of your theme? (for theme-magesuite, use magesuite)',
},
{
type: 'input',
name: 'packageName',
message: 'What should be the package name for this theme?',
default: answers => `theme-${answers.name.toLowerCase()}`,
},
{
type: 'input',
name: 'repository',
message:
'[Optional] What is the URL of Git repository for this theme?',
},
])
.then(answers => {
return steps
.clone(answers)
.then(() => steps.registration(answers))
.then(() => steps.composer(answers))
.then(() => steps.theme(answers))
.then(() => steps.preview(answers))
.then(() => steps.init(answers))
.catch(error => console.error(error.message))
.then(() => console.log(`Success! Generated theme-${answers.name.toLowerCase()}!`));
});