forked from nklayman/vue-cli-plugin-electron-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.js
44 lines (43 loc) · 1.29 KB
/
ui.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
const prompts = require('./uiOptions')
module.exports = api => {
api.describeTask({
match: /vue-cli-service electron:build/,
description: 'Build your app for production with electron-builder',
link: 'https://nklayman.github.io/vue-cli-plugin-electron-builder/',
prompts,
onBeforeRun: ({ answers, args }) => {
// Args
if (answers.dir) args.push('--dir')
if (answers.windows) {
args.push('--windows')
// For each windows target, add it after --windows
answers.windowsTargets.forEach(t => {
args.push(t)
})
}
if (answers.linux) {
args.push('--linux')
// For each linux target, add it after --linux
answers.linuxTargets.forEach(t => {
args.push(t)
})
}
if (answers.macos) {
args.push('--macos')
// For each macos target, add it after --macos
answers.macosTargets.forEach(t => {
args.push(t)
})
}
// add --[arch] for each architecture target
answers.archs.forEach(a => {
args.push(`--${a}`)
})
}
})
api.describeTask({
match: /vue-cli-service electron:serve/,
description: 'Serve your app, launch electron',
link: 'https://nklayman.github.io/vue-cli-plugin-electron-builder/'
})
}