From 04d1cf2e6e2a8ec86c9ed973ac90d5c6d97004b1 Mon Sep 17 00:00:00 2001 From: "Keran.Braich" Date: Wed, 11 Apr 2018 15:37:23 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Update=20Heroku=20error=20to=20make=20it=20?= =?UTF-8?q?clearer=20when=20build=20fails=20=20=F0=9F=90=BF=20v2.8.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tasks/destroy.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tasks/destroy.js b/tasks/destroy.js index 00fdd44a..9e236b06 100644 --- a/tasks/destroy.js +++ b/tasks/destroy.js @@ -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, {verbose: true }).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) { From bd2a10b2e44883587df14f9614bdb4f0719988aa Mon Sep 17 00:00:00 2001 From: Keran Braich <30316203+ker-an@users.noreply.github.com> Date: Wed, 11 Apr 2018 16:00:12 +0100 Subject: [PATCH 2/2] Remove unnecessary verbose statement --- tasks/destroy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/destroy.js b/tasks/destroy.js index 9e236b06..1b7f6ea2 100644 --- a/tasks/destroy.js +++ b/tasks/destroy.js @@ -6,7 +6,7 @@ function task (options) { let app = options.app; let verbose = options.verbose; - return spawn('heroku info ' + app, {verbose: true }).then(function () { + return spawn('heroku info ' + app).then(function () { let promise = Promise.resolve(); if (verbose) { promise = promise.then(function () {