heroku-cli-addons
Advanced tools
Comparing version 1.2.18 to 1.2.19
@@ -12,14 +12,18 @@ 'use strict' | ||
function createAttachment (app, as, confirm) { | ||
function createAttachment (app, as, confirm, credential) { | ||
let body = { | ||
name: as, | ||
app: {name: app}, | ||
addon: {name: addon.name}, | ||
confirm | ||
} | ||
if (credential) { | ||
body.namespace = 'credential:' + credential | ||
} | ||
return cli.action( | ||
`Attaching ${cli.color.addon(addon.name)}${as ? ' as ' + cli.color.attachment(as) : ''} to ${cli.color.app(app)}`, | ||
`Attaching ${credential ? cli.color.addon(credential) + ' of ' : ''}${cli.color.addon(addon.name)}${as ? ' as ' + cli.color.attachment(as) : ''} to ${cli.color.app(app)}`, | ||
heroku.request({ | ||
path: '/addon-attachments', | ||
method: 'POST', | ||
body: { | ||
name: as, | ||
app: {name: app}, | ||
addon: {name: addon.name}, | ||
confirm | ||
} | ||
body: body | ||
}) | ||
@@ -29,3 +33,3 @@ ) | ||
let attachment = yield util.trapConfirmationRequired(context.app, context.flags.confirm, (confirm) => createAttachment(app, context.flags.as, confirm)) | ||
let attachment = yield util.trapConfirmationRequired(context.app, context.flags.confirm, (confirm) => createAttachment(app, context.flags.as, confirm, context.flags.credential)) | ||
@@ -53,2 +57,3 @@ yield cli.action( | ||
{name: 'as', description: 'name for add-on attachment', hasValue: true}, | ||
{name: 'credential', description: 'credential name for scoped access to Heroku Postgres', hasValue: true}, | ||
{name: 'confirm', description: 'overwrite existing add-on attachment with same name', hasValue: true} | ||
@@ -55,0 +60,0 @@ ], |
{ | ||
"name": "heroku-cli-addons", | ||
"description": "`heroku addons:*` commands", | ||
"version": "1.2.18", | ||
"version": "1.2.19", | ||
"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
126511
1204