Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

heroku-cli-addons

Package Overview
Dependencies
Maintainers
7
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

heroku-cli-addons - npm Package Compare versions

Comparing version 1.1.4 to 1.1.5

10

commands/addons/attach.js

@@ -7,2 +7,4 @@ 'use strict'

function * run (context, heroku) {
const util = require('../../lib/util')
let app = context.app

@@ -27,8 +29,4 @@ let addon = yield heroku.get(`/addons/${encodeURIComponent(context.args.addon_name)}`)

let attachment = yield createAttachment(app, context.flags.as, context.flags.confirm)
.catch((err) => {
if (!err.body || err.body.id !== 'confirmation_required') throw err
return cli.confirmApp(app, context.flags.confirm, err.body.message)
.then(() => createAttachment(app, context.flags.as, app))
})
let attachment = yield util.trapConfirmationRequired(context, (confirm) => createAttachment(app, context.flags.as, confirm))
yield cli.action(

@@ -35,0 +33,0 @@ `Setting ${cli.color.attachment(attachment.name)} config vars and restarting ${cli.color.app(app)}`,

29

commands/addons/create.js

@@ -48,20 +48,23 @@ 'use strict'

let {app, flags, args} = context
let {name, as, confirm} = flags
let {name, as} = flags
let plan = {name: args[0]}
let config = parseConfig(args.slice(1))
let addon
function createAddon (app, config, name, confirm, plan, as) {
return cli.action(`Creating ${plan.name} on ${cli.color.app(app)}`,
heroku.post(`/apps/${app}/addons`, {
body: { config, name, confirm, plan, attachment: {name: as} },
headers: {
'accept-expansion': 'plan',
'x-heroku-legacy-provider-messages': 'true'
}
}).then(function (addon) {
cli.action.done(cli.color.green(util.formatPrice(addon.plan.price)))
return addon
})
)
}
yield cli.action(`Creating ${plan.name} on ${cli.color.app(app)}`, co(function * () {
addon = yield heroku.post(`/apps/${app}/addons`, {
body: { config, name, confirm, plan, attachment: {name: as} },
headers: {
'accept-expansion': 'plan',
'x-heroku-legacy-provider-messages': 'true'
}
})
let addon = yield util.trapConfirmationRequired(context, (confirm) => (createAddon(app, config, name, confirm, plan, as)))
cli.action.done(cli.color.green(util.formatPrice(addon.plan.price)))
}))
if (addon.provision_message) { cli.log(addon.provision_message) }

@@ -68,0 +71,0 @@

@@ -51,3 +51,13 @@ 'use strict'

return state
},
trapConfirmationRequired: function * (context, fn) {
return yield fn(context.flags.confirm)
.catch((err) => {
if (!err.body || err.body.id !== 'confirmation_required') throw err
return cli.confirmApp(context.app, context.flags.confirm, err.body.message)
.then(() => fn(context.app))
})
}
}
{
"name": "heroku-cli-addons",
"description": "`heroku addons:*` commands",
"version": "1.1.4",
"version": "1.1.5",
"author": "Bo Jeanes @bjeanes",

@@ -6,0 +6,0 @@ "bugs": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc