-
Notifications
You must be signed in to change notification settings - Fork 228
/
Copy pathinfo.ts
31 lines (26 loc) · 881 Bytes
/
info.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
import {Command, flags} from '@heroku-cli/command'
import * as Heroku from '@heroku-cli/schema'
import {Args, ux} from '@oclif/core'
export default class DomainsInfo extends Command {
static description = 'show detailed information for a domain on an app'
static examples = [
'$ heroku domains:info www.example.com',
]
static flags = {
help: flags.help({char: 'h'}),
app: flags.app({required: true}),
remote: flags.remote(),
}
static args = {
hostname: Args.string({required: true, description: 'unique identifier of the domain or full hostname'}),
}
async run() {
const {args, flags} = await this.parse(DomainsInfo)
const {body: res} = await this.heroku.get<Heroku.Domain>(`/apps/${flags.app}/domains/${args.hostname}`)
const domain = {
...res,
app: res.app && res.app.name,
}
ux.styledObject(domain)
}
}