/
magento.ts
45 lines (38 loc) · 968 Bytes
/
magento.ts
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
import {flags} from '@oclif/command'
import Command from '../base'
import Const from './../const'
export default class Magento extends Command {
static description = 'Magento'
static strict = false
static args = [
{
name: Const.ARG_PROJECT,
required: true,
description: 'project name',
hidden: false
}
]
static flags = {
...Command.flags,
source: flags.boolean({
char: 's',
description: 'with source'
}),
local: flags.boolean({
char: 'l',
description: 'locally'
}),
debug: flags.boolean({
char: 'd',
description: 'debug flag',
required: false
})
}
async run() {
const project = this.args[Const.ARG_PROJECT]
const docker = await this.getDocker()
const argv = process.argv.slice(4).filter(e => e != '-d' && e != '--debug')
let cmd = `php bin/magento ${argv.join(' ')}`
await docker.webCmd(project, cmd, this.flags.debug)
}
}