Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #503 from Financial-Times/kb/update-error-message
Browse files Browse the repository at this point in the history
Update Heroku error to make it clearer when build fails
  • Loading branch information
ker-an authored Apr 11, 2018
2 parents 5678844 + bd2a10b commit a401773
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions tasks/destroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,22 @@ let spawn = require('shellpromise');
function task (options) {
let app = options.app;
let verbose = options.verbose;
let promise = Promise.resolve();
if (verbose) {
promise = promise.then(function () {

return spawn('heroku info ' + app).then(function () {
let promise = Promise.resolve();
if (verbose) {
promise = promise.then(function () {
// `|| echo` to stop this failing failing builds
return spawn('heroku logs -a ' + app + ' || echo', { verbose: true });
});
}
promise = promise.then(function () {
}
promise = promise.then(function () {
return spawn('heroku destroy -a ' + app + ' --confirm ' + app, { verbose: true });
});
return promise;
return promise;
}).catch(function () {
console.log(app + ' does not exist'); // eslint-disable-line no-console
});
};

module.exports = function (program, utils) {
Expand Down

0 comments on commit a401773

Please sign in to comment.