-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathplopfile.mjs
35 lines (30 loc) · 982 Bytes
/
plopfile.mjs
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
import { createRequire } from "module";
import path from "path";
import { fileURLToPath } from "url";
const require = createRequire(import.meta.url);
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const {
setActions: setApplicationActions,
getActions: getApplicationActions
} = require(`${__dirname}/plopComponents/actions`);
const { renderPrompts: renderApplicationPrompts } = require(`${__dirname}/plopComponents/prompts`);
export default function (plop) {
setApplicationActions(plop, __dirname);
plop.setGenerator("vectara-create", {
description: "Configuration Variables",
prompts: async (inquirer) => {
const answers = await renderApplicationPrompts(inquirer);
return {
category: "application",
...answers
};
},
actions: function (data) {
switch (data.category) {
default:
return getApplicationActions(data, __dirname);
}
}
});
}