Adding check to deploy script for file to delete before attempting

This commit is contained in:
Jeff Avallone 2018-05-31 17:26:32 -04:00
parent 1eb3ca9182
commit b575b9a0cc

View File

@ -62,6 +62,11 @@ Promise.all([bucketContents, uploadDetails]).then(([bucket, upload]) => {
return Promise.all(uploadPromises)
.then(() => {
if (deleteKeys.length === 0) {
console.log('No files to delete');
return Promise.resolve();
}
console.log(`Deleting ${ deleteKeys.length } stale files`);
return s3.deleteObjects({
Bucket: config.s3Bucket,