1 | 'use strict'
|
2 |
|
3 | let cli = require('heroku-cli-util')
|
4 | let co = require('co')
|
5 |
|
6 | function * run (context, heroku) {
|
7 | let lib = require('../../lib/log-drains')(heroku)
|
8 | let space = context.flags.space
|
9 | let drain = yield lib.putLogDrain(space, context.args.url)
|
10 | cli.log(`Successfully set drain ${cli.color.cyan(drain.url)} for ${cli.color.cyan.bold(space)}.`)
|
11 | cli.warn('It may take a few moments for the changes to take effect.')
|
12 | }
|
13 |
|
14 | module.exports = {
|
15 | topic: 'drains',
|
16 | command: 'set',
|
17 | hidden: true,
|
18 | description: 'replaces the log drain for a space',
|
19 | needsApp: false,
|
20 | needsAuth: true,
|
21 | args: [
|
22 | {name: 'url'}
|
23 | ],
|
24 | flags: [
|
25 | {name: 'space', char: 's', hasValue: true, description: 'space for which to set log drain', required: true}
|
26 | ],
|
27 | run: cli.command(co.wrap(run))
|
28 | }
|