forked from quasarframework/quasar
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mode-bex.js
35 lines (28 loc) · 833 Bytes
/
mode-bex.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
const fs = require('fs')
const fse = require('fs-extra')
const appPaths = require('../app-paths')
const { log, warn } = require('../helpers/logger')
class Mode {
get isInstalled () {
return fs.existsSync(appPaths.bexDir)
}
add () {
if (this.isInstalled) {
warn(`Browser Extension support detected already. Aborting.`)
return
}
log(`Creating Browser Extension source folder...`)
fse.copySync(appPaths.resolve.cli('templates/bex'), appPaths.bexDir)
log(`Browser Extension support was added`)
}
remove () {
if (!this.isInstalled) {
warn(`No Browser Extension support detected. Aborting.`)
return
}
log(`Removing Browser Extension source folder`)
fse.removeSync(appPaths.bexDir)
log(`Browser Extension support was removed`)
}
}
module.exports = Mode