-
Notifications
You must be signed in to change notification settings - Fork 0
/
before.js
45 lines (36 loc) · 1.26 KB
/
before.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
module.exports = async function ({ unattended, prompts, predefinedProperties }) {
if (unattended) { return }
const preselectedFeatures = []
const extensionType = await prompts.select(
{
message: "The extension's type?",
choices: [
{ value: 'hello-world', title: 'Hello World' },
{ value: 'widget', title: 'Widget (with unit tests)' },
{ value: 'labelprovider', title: 'LabelProvider' },
{ value: 'tree-editor', title: 'Tree Editor' },
{ value: 'backend', title: 'Backend Communication' },
{ value: 'empty', title: 'Empty' }
]
})
preselectedFeatures.push(extensionType)
const explicit = await prompts.select({
message: 'Specify additional settings?',
hint: 'author, theia version, github url etc..',
choices: [
{ title: 'No. Procede with defaults' },
{ value: 'explicit', title: 'Go through the rest of questions' }
]
})
if (!explicit) {
return {
silentQuestions: true,
predefinedProperties,
preselectedFeatures
}
}
return {
predefinedProperties,
preselectedFeatures
};
};