Skip to content

Commit

Permalink
Delayed initialisation of s3 after configuring it
Browse files Browse the repository at this point in the history
  • Loading branch information
pazdera committed Jan 11, 2018
1 parent 5ca727f commit e74e2c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/s3-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ const aws = require('aws-sdk');

/* Keep a global reference se we can
override it with a mock for testing. */
let s3 = new aws.S3();
let s3 = null;

function getInstance() {
if (!s3) {
s3 = new aws.S3();
}

return s3;
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kart",
"version": "0.6.1",
"version": "0.6.2",
"description": "Kano Archive and Release Tool. Managing releases mainly of static websites.",
"main": "lib/index.js",
"bin": {
Expand Down

0 comments on commit e74e2c7

Please sign in to comment.