Adding check to deploy script for file to delete before attempting
This commit is contained in:
parent
1eb3ca9182
commit
b575b9a0cc
@ -62,6 +62,11 @@ Promise.all([bucketContents, uploadDetails]).then(([bucket, upload]) => {
|
|||||||
|
|
||||||
return Promise.all(uploadPromises)
|
return Promise.all(uploadPromises)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
if (deleteKeys.length === 0) {
|
||||||
|
console.log('No files to delete');
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
|
||||||
console.log(`Deleting ${ deleteKeys.length } stale files`);
|
console.log(`Deleting ${ deleteKeys.length } stale files`);
|
||||||
return s3.deleteObjects({
|
return s3.deleteObjects({
|
||||||
Bucket: config.s3Bucket,
|
Bucket: config.s3Bucket,
|
||||||
|
Loading…
Reference in New Issue
Block a user