heroku-cli-addons
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -12,10 +12,17 @@ 'use strict' | ||
key = key.replace(/^--/, '') | ||
let val = args.shift() | ||
if (!val) { | ||
config[key] = true | ||
} else if (val.startsWith('--')) { | ||
config[key] = true | ||
args.unshift(val) | ||
let val | ||
if (key.includes('=')) { | ||
[key, ...val] = key.split('=') | ||
val = val.join('=') | ||
config[key] = val | ||
} else { | ||
config[key] = val | ||
val = args.shift() | ||
if (!val) { | ||
config[key] = true | ||
} else if (val.startsWith('--')) { | ||
config[key] = true | ||
args.unshift(val) | ||
} else { | ||
config[key] = val | ||
} | ||
} | ||
@@ -26,11 +33,2 @@ } | ||
function expandHPG (plan) { | ||
if (!plan) throw new Error('Missing requested service or plan') | ||
plan = plan.replace(/^hpg:/, 'heroku-postgresql:') | ||
plan = plan.replace(/^heroku-postgresql:s-/, 'heroku-postgresql:standard-') | ||
plan = plan.replace(/^heroku-postgresql:p-/, 'heroku-postgresql:premium-') | ||
plan = plan.replace(/^heroku-postgresql:e-/, 'heroku-postgresql:enterprise-') | ||
return plan | ||
} | ||
function * run (context, heroku) { | ||
@@ -41,4 +39,4 @@ const util = require('../../lib/util') | ||
let {name, as, confirm} = flags | ||
let plan = {name: expandHPG(args.shift())} | ||
let config = parseConfig(args) | ||
let plan = {name: args[0]} | ||
let config = parseConfig(args.slice(1)) | ||
@@ -56,4 +54,8 @@ let addon | ||
})) | ||
let configVars = addon.config_vars.map(c => cli.color.configVar(c)).join(', ') | ||
cli.log(`Created ${cli.color.addon(addon.name)} as ${configVars}`) | ||
if (addon.config_vars.length) { | ||
let configVars = addon.config_vars.map(c => cli.color.configVar(c)).join(', ') | ||
cli.log(`Created ${cli.color.addon(addon.name)} as ${configVars}`) | ||
} else { | ||
cli.log(`Created ${cli.color.addon(addon.name)}`) | ||
} | ||
if (addon.provision_message) cli.log(addon.provision_message) | ||
@@ -60,0 +62,0 @@ cli.log(`Use ${cli.color.cmd('heroku addons:docs ' + addon.addon_service.name)} to view documentation`) |
{ | ||
"name": "heroku-cli-addons", | ||
"description": "`heroku addons:*` commands", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"author": "Bo Jeanes @bjeanes", | ||
@@ -6,0 +6,0 @@ "bugs": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
895
36746