-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplop.js
30 lines (28 loc) · 820 Bytes
/
plop.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
export default function (plop) {
plop.setGenerator('test', {
prompts: [
{
type: 'confirm',
name: 'wantTacos',
message: 'Do you want tacos?',
},
],
actions: function (data) {
var actions = []
if (data.wantTacos) {
actions.push({
type: 'add',
path: 'folder/{{dashCase name}}.txt',
templateFile: 'templates/tacos.txt',
})
} else {
actions.push({
type: 'add',
path: 'folder/{{dashCase name}}.txt',
templateFile: 'templates/burritos.txt',
})
}
return actions
},
})
}