UNPKG

932 BJavaScriptView Raw
1'use strict'
2
3let cli = require('heroku-cli-util')
4let co = require('co')
5
6function * run (context, heroku) {
7 let appName = context.app
8 let request = heroku.delete(`/apps/${appName}/collaborators/${context.args.email}`)
9 yield cli.action(`Removing ${cli.color.cyan(context.args.email)} access from the app ${cli.color.magenta(appName)}`, request)
10}
11
12module.exports = [
13 {
14 topic: 'access',
15 needsAuth: true,
16 needsApp: true,
17 command: 'remove',
18 description: 'Remove users from your app',
19 help: 'heroku access:remove user@email.com --app APP',
20 args: [{name: 'email', optional: false}],
21 run: cli.command(co.wrap(run))
22 },
23 {
24 topic: 'sharing',
25 command: 'remove',
26 help: 'this command is now heroku access:remove',
27 variableArgs: true,
28 hidden: true,
29 run: () => {
30 cli.error(`This command is now ${cli.color.cyan('heroku access:remove')}`)
31 process.exit(1)
32 }
33 }
34]