@heroku-cli/heroku-exec-util
Advanced tools
Comparing version 0.8.2 to 0.9.0
@@ -60,6 +60,5 @@ 'use strict' | ||
function * initFeature(context, heroku, callback) { | ||
function * initFeature(context, heroku, command = undefined, callback) { | ||
var buildpackUrls = ["https://github.com/heroku/exec-buildpack", "urn:buildpack:heroku/exec"] | ||
let promises = { | ||
app: heroku.get(`/apps/${context.app}`), | ||
feature: heroku.get(`/apps/${context.app}/features/runtime-heroku-exec`), | ||
@@ -73,2 +72,16 @@ config: heroku.get(`/apps/${context.app}/config-vars`), | ||
const app = yield heroku.get(`/apps/${context.app}`, { | ||
headers: { | ||
Accept: 'application/vnd.heroku+json; version=3.sdk' | ||
} | ||
}) | ||
if (app.generation === 'fir') { | ||
const errorMessage = command === 'exec' ? | ||
'This command is unavailable for this app. Use `heroku run:inside` instead. See https://devcenter.heroku.com/articles/run-tasks-in-an-existing-dyno.' : | ||
'This command is unavailable for this app. See https://devcenter.heroku.com/articles/generations.' | ||
cli.error(errorMessage) | ||
cli.exit(1); | ||
} | ||
let data = yield promises | ||
@@ -79,7 +92,7 @@ let feature = data.feature | ||
if (data.app['space'] != null) { | ||
if (data.app['space']['shield'] === true) { | ||
if (app['space'] != null) { | ||
if (app['space']['shield'] === true) { | ||
cli.error(`This feature is restricted for Shield Private Spaces`) | ||
cli.exit(1); | ||
} else if (data.app['build_stack']['name'] === 'container') { | ||
} else if (app['build_stack']['name'] === 'container') { | ||
cli.warn(`${context.app} is using the container stack which is not officially supported.`); | ||
@@ -96,3 +109,3 @@ } else if (buildpacks.length === 0) { | ||
cli.log(cli.color.magenta(' git commit -m "Heroku Exec initialization" --allow-empty')) | ||
cli.log(cli.color.magenta(' git push heroku master')) | ||
cli.log(cli.color.magenta(' git push heroku main')) | ||
cli.exit(0); | ||
@@ -99,0 +112,0 @@ } |
{ | ||
"name": "@heroku-cli/heroku-exec-util", | ||
"description": "Set of helpful Heroku Exec utilities", | ||
"version": "0.8.2", | ||
"version": "0.9.0", | ||
"author": "Joe Kutner", | ||
@@ -6,0 +6,0 @@ "bugs": { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
18864
502
3