gulp-s3-upload
Advanced tools
Comparing version 0.7.0 to 0.7.1
34
index.js
@@ -1,3 +0,1 @@ | ||
"use strict"; | ||
var through = require('through2') | ||
@@ -9,3 +7,2 @@ , gutil = require('gulp-util') | ||
, PluginError = gutil.PluginError | ||
, s3, s3_params | ||
; | ||
@@ -15,3 +12,3 @@ | ||
function gulpPrefixer(s3) { | ||
function gulpPrefixer(AWS) { | ||
/* | ||
@@ -26,2 +23,3 @@ options = { | ||
var stream, keyname_transform; | ||
var _s3 = new AWS.S3(); | ||
@@ -53,7 +51,9 @@ if(!options.bucket) { | ||
s3.client.getObject({ | ||
Bucket: s3_params.Bucket | ||
_s3.getObject({ | ||
Bucket: options.bucket | ||
, Key: keyname | ||
}, function(getErr, getData) { | ||
s3.client.putObject({ | ||
gutil.colors.red("S3 Error:", getErr); | ||
_s3.putObject({ | ||
Bucket: options.bucket, | ||
@@ -87,3 +87,3 @@ ACL: options.acl || 'public-read', | ||
return stream; | ||
} | ||
}; | ||
}; | ||
@@ -93,2 +93,11 @@ | ||
module.exports = function(config) { | ||
var aws_config = {}; | ||
aws_config.accessKeyId = config.key; | ||
aws_config.secretAccessKey = config.secret; | ||
if(config.region) { | ||
aws_config.region = config.region; | ||
} | ||
if(!config) { | ||
@@ -99,10 +108,5 @@ throw new PluginError(PLUGIN_NAME, "Missing AWS Key & secret."); | ||
AWS.config.update({ | ||
accessKeyId: config.key | ||
, secretAccessKey: config.secret | ||
}); | ||
AWS.config.update(aws_config); | ||
s3 = new AWS.S3(); | ||
return gulpPrefixer(s3); | ||
return gulpPrefixer(AWS); | ||
} |
{ | ||
"name": "gulp-s3-upload", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"description": "A gulp task to upload/update assets to an S3 account.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -20,5 +20,5 @@ # gulp-s3-upload | ||
var s3 = require('gulp-s3-upload')({ | ||
accessKeyId: "YOUR DEV ID", | ||
secretAccessKey: "YOUR SECRET", | ||
region: "us-west-2" // optional | ||
key: "YOUR DEV ID", | ||
secret: "YOUR SECRET", | ||
region: "us-west-2" // optional | ||
}); | ||
@@ -25,0 +25,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7371
98