From 6f1308a125ab2d38b5d25ae19eb393d1c5c85bdc Mon Sep 17 00:00:00 2001 From: Arjun Gadhia Date: Tue, 21 Nov 2017 12:06:01 +0000 Subject: [PATCH] =?UTF-8?q?Refactor=20so=20logging=20works=20=20?= =?UTF-8?q?=F0=9F=90=BF=20v2.5.16?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tasks/deploy-hashed-assets.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tasks/deploy-hashed-assets.js b/tasks/deploy-hashed-assets.js index b8652ac7..d15ada7c 100644 --- a/tasks/deploy-hashed-assets.js +++ b/tasks/deploy-hashed-assets.js @@ -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); @@ -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}`),