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 configVars = yield heroku.request({path: `/apps/${context.app}/config-vars`});
let v = configVars[context.args.key];
if (v === undefined) {
cli.log(''); // match v3 output for missing
} else {
if (context.flags.shell) {
v = process.stdout.isTTY ? shellescape([v]) : v;
cli.log(`${context.args.key}=${v}`);
} else {
cli.log(v);
}
}
}
function printFeatures (features) {
const { sortBy } = require('lodash')
features = sortBy(features, 'name')
let longest = Math.max.apply(null, features.map((f) => f.name.length))
for (let f of features) {
let line = `${f.enabled ? '[+]' : '[ ]'} ${f.name.padEnd(longest)}`
if (f.enabled) line = cli.color.green(line)
line = `${line} ${f.description}`
cli.log(line)
}
}
function printFeatures (features) {
const {sortBy} = require('lodash')
features = sortBy(features, 'name')
let longest = Math.max.apply(null, features.map((f) => f.name.length))
for (let f of features) {
let line = `${f.enabled ? '[+]' : '[ ]'} ${f.name.padEnd(longest)}`
if (f.enabled) line = cli.color.green(line)
line = `${line} ${f.description}`
cli.log(line)
}
}
function * run (context, heroku) {
let app = yield heroku.get(`/apps/${context.app}`)
cli.log(app.maintenance ? 'on' : 'off')
}
function * run (context, heroku) {
const pipeline = yield Utils.getPipeline(context, heroku)
const config = yield api.configVars(heroku, pipeline.id)
const value = config[context.args.key]
if (context.flags.shell) {
cli.log(`${context.args.key}=${shellescape([value])}`)
} else {
cli.log(value)
}
}