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

Commit

Permalink
Refactor so logging works
Browse files Browse the repository at this point in the history
 🐿 v2.5.16
  • Loading branch information
adgad committed Nov 21, 2017
1 parent ccda05e commit 6f1308a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tasks/deploy-hashed-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ function task (opts) {
region
});

const s3EUBucket = new aws.S3({ params: { Bucket: bucket } });
const s3USBucket = new aws.S3({ params: { Bucket: usBucket } });


function upload (bucket, params) {

const s3Bucket = new aws.S3({ params: { Bucket: bucket } });
return new Promise((resolve, reject) => {
return bucket.upload(params, (err, data) => {
return s3Bucket.upload(params, (err, data) => {
if (err) {
console.error(`Upload failed to ${bucket}`, err); // eslint-disable-line no-console
reject(err);
Expand Down Expand Up @@ -108,8 +106,8 @@ function task (opts) {
break;
}
return Promise.all([
upload(s3EUBucket, params),
upload(s3USBucket, params)
upload(bucket, params),
upload(usBucket, params)
])
.then(() => Promise.all([
waitForOk(`http://${bucket}.s3-website-${region}.amazonaws.com/${key}`),
Expand Down

0 comments on commit 6f1308a

Please sign in to comment.