-
Notifications
You must be signed in to change notification settings - Fork 14
/
publish.js
32 lines (24 loc) · 949 Bytes
/
publish.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
const { Args } = require('@oclif/core')
const { getDomainIdentifierArg, splitPathParams } = require('../../support/command/parse-input')
const BaseCommand = require('../../support/command/base-command')
const UpdateCommand = require('../../support/command/update-command')
class PublishCommand extends UpdateCommand {
async run() {
const { args } = await this.parse(PublishCommand)
const domainPath = getDomainIdentifierArg(args)
const [owner, name, version] = splitPathParams(domainPath)
await this.updatePublish('domains', owner, name, version, true)
}
}
PublishCommand.description = 'publish a domain version'
PublishCommand.examples = [
'swaggerhub domain:publish organization/domain/1.0.0'
]
PublishCommand.args = {
'OWNER/DOMAIN_NAME/VERSION': Args.string({
required: true,
description: 'Domain to publish on SwaggerHub'
})
}
PublishCommand.flags = BaseCommand.flags
module.exports = PublishCommand