-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplopfile.js
More file actions
54 lines (50 loc) · 1.65 KB
/
Copy pathplopfile.js
File metadata and controls
54 lines (50 loc) · 1.65 KB
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
46
47
48
49
50
51
52
53
54
const {
SupportedAdobeProducts,
getAdobeExtPath,
getDebugPath,
getTemplatesPath,
getDebugTemplatesPath,
makePluginID,
} = require('./generator/helpers.js');
module.exports = function (plop) {
plop.setGenerator('make', {
description: 'Create a new adobe plugin',
prompts: [
{
type: 'input',
name: 'name',
message: '👋 What would you like to call your plugin?'
},
{
type: 'list',
name: 'product',
choices: SupportedAdobeProducts,
message: 'Which Adobe product are you building a plugin for?'
},
{
type: 'list',
name: 'wantDevServer',
choices: [ 'yes', 'no'],
message: 'Would you like a dev sever set up for you? (localhost:7777)'
},
],
actions: function(data) {
plop.setPartial('pluginID', makePluginID(data.name));
let actions = [{
type: 'addMany',
// destination: 'GeneratedPlugins/{{ pascalCase name }}',
destination: getAdobeExtPath(data.name),
base: getTemplatesPath(data.product).path,
templateFiles: getTemplatesPath(data.product).glob,
}];
if(data.wantDevServer === 'yes') {
actions.push({
type: 'add',
path: getDebugPath(data.name),
templateFile: getDebugTemplatesPath(data.product)
});
}
return actions;
}
});
};