1 | 'use strict'
|
2 |
|
3 | let cli = require('heroku-cli-util')
|
4 | let co = require('co')
|
5 | let Utils = require('../../lib/utils')
|
6 |
|
7 | function * run (context, heroku) {
|
8 | let orgs = yield heroku.get('/organizations')
|
9 | let teams = orgs.filter(o => o.type === 'team')
|
10 | if (context.flags.json) Utils.printGroupsJSON(teams)
|
11 | else Utils.printGroups(teams, {label: 'Teams'})
|
12 | }
|
13 | module.exports = {
|
14 | topic: 'teams',
|
15 | description: 'list the teams that you are a member of',
|
16 | needsAuth: true,
|
17 | flags: [
|
18 | {name: 'json', description: 'output in json format'}
|
19 | ],
|
20 | run: cli.command(co.wrap(run))
|
21 | }
|