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 (context, heroku) {
let feature
try {
feature = yield heroku.get(`/account/features/${context.args.feature}`)
} catch (err) {
if (err.statusCode !== 404) throw err
// might be an app feature
if (!context.app) throw err
feature = yield heroku.get(`/apps/${context.app}/features/${context.args.feature}`)
}
if (context.flags.json) {
cli.styledJSON(feature)
} else {
print(feature)
}
}