Merge pull request #1410 from serverless/add-better-stack-identification-on-stack-removal

Add better stack identification on stack removal
This commit is contained in:
Philipp Muens 2016-06-27 12:25:52 +02:00 committed by GitHub
commit a2e9edb8e7

View File

@ -47,7 +47,17 @@ module.exports = {
.then((data) => {
stackSummaries = data.StackSummaries;
const stack = _.find(stackSummaries, { StackName: stackName });
let convertedStackSummary = {};
// convert DeletionTime to UNIX timestamp
stackSummaries.forEach((stackSummary) => {
convertedStackSummary = stackSummary;
convertedStackSummary.DeletionTime = (new Date(stackSummary.DeletionTime))
.getTime() / 1000;
});
const stack = _.find(
_.orderBy(stackSummaries, 'DeletionTime', 'desc'), { StackName: stackName }
);
stackStatus = stack.StackStatus;
this.serverless.cli.log('Checking stack removal progress...');