forked from m0dch3n/vue-cli-plugin-cordova
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prompts.js
56 lines (54 loc) · 1.2 KB
/
prompts.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
46
47
48
49
50
51
52
53
54
55
56
const hasbin = require('hasbin')
const defaults = require('./defaults')
const hasCordova = hasbin.sync('cordova')
const prompts = [
{
name: 'cordovaPath',
type: 'string',
message: 'Name of folder where cordova should be installed',
default: defaults.cordovaPath,
validate: opt => opt && opt.length >= 0
},
{
name: 'id',
type: 'string',
message: 'ID of the app',
default: defaults.id,
validate: opt => opt && opt.length >= 0
},
{
name: 'appName',
type: 'string',
message: 'Name of the app',
default: defaults.appName,
validate: opt => opt && opt.length >= 0
},
{
name: 'platforms',
type: 'checkbox',
message: 'Select Platforms:',
choices: [
{
name: 'Android',
value: 'android',
checked: !!defaults.platforms['android']
},
{
name: 'iOS',
value: 'ios',
checked: !!defaults.platforms['ios']
},
{
name: 'Browser',
value: 'browser',
checked: !!defaults.platforms['browser']
},
{
name: 'OSX',
value: 'osx',
checked: !!defaults.platforms['osx']
}
]
}
]
module.exports = hasCordova ? prompts : null