-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.js
37 lines (34 loc) · 1.16 KB
/
init.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
const Command = require('../base.js')
const InitExtensionService = require('../services/initExtension')
const MarketplaceOrganizationService = require('../services/marketplaceOrganization')
const marketplaceOrganizationService = new MarketplaceOrganizationService()
const Logger = require('../config/logger')
class InitCommand extends Command {
constructor () {
super(...arguments)
const commandName = this.id
this.logger = Logger.child({
tag: `command/${commandName}`
})
this.initExtensionService = new InitExtensionService({
logger: this.logger
})
}
async run () {
const [extension] = await Promise.all([
this.initExtensionService.promptExtensionInfo(),
marketplaceOrganizationService.downloadTemplate()
])
const dynamicComponent =
await this.initExtensionService.createDynamicComponent(extension)
this.initExtensionService.copyTemplateToCWD({
extensionType: extension.type
})
this.initExtensionService.initializeManifestAccordingWithType(
dynamicComponent
)
}
static description =
'Inicializa um projeto Vue para uma ou mais extensões do Quoti'
}
module.exports = InitCommand