Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function * run () {
const Heroku = require('heroku-client')
if (process.env.HEROKU_API_KEY) {
cli.warn('HEROKU_API_KEY is set. Not using netrc credentials.')
}
let token = cli.auth.token()
if (!token) cli.exit(1, 'not logged in')
let heroku = new Heroku({token})
let account = yield heroku.get('/account')
cli.log(account.email)
}
function* patchConfig(context, heroku, payload, success) {
try {
yield heroku.patch(`/apps/${context.app}/config-vars`, { body: payload })
if (!context.flags.quiet) {
cli.log(success)
}
} catch (err) {
cli.exit(1, err)
}
}