UNPKG

576 BJavaScriptView Raw
1'use strict'
2
3let cli = require('heroku-cli-util')
4let co = require('co')
5let Utils = require('../../lib/utils')
6
7function * 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}
13module.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}