gulp-awspublish
Advanced tools
Comparing version 4.1.0 to 4.1.1
@@ -11,3 +11,4 @@ var AWS = require('aws-sdk'), | ||
Vinyl = require('vinyl'), | ||
PluginError = require('plugin-error'); | ||
PluginError = require('plugin-error'), | ||
chunk = require('lodash.chunk'); | ||
@@ -126,8 +127,10 @@ var PLUGIN_NAME = 'gulp-awspublish'; | ||
}); | ||
return { | ||
Delete: { | ||
Objects: deleteObjects | ||
} | ||
}; | ||
var chunks = chunk(deleteObjects, 1000); | ||
return chunks.map(function(each) { | ||
return { | ||
Delete: { | ||
Objects: each | ||
} | ||
}; | ||
}); | ||
} | ||
@@ -437,3 +440,13 @@ | ||
if (!toDelete.length) return cb(); | ||
client.deleteObjects(buildDeleteMultiple(toDelete), cb); | ||
Promise.all( | ||
buildDeleteMultiple(toDelete).map(function(each) { | ||
return client.deleteObjects(each).promise(); | ||
}) | ||
) | ||
.then(function() { | ||
cb(); | ||
}) | ||
.catch(function(e) { | ||
cb(e); | ||
}); | ||
}); | ||
@@ -440,0 +453,0 @@ }; |
{ | ||
"name": "gulp-awspublish", | ||
"version": "4.1.0", | ||
"version": "4.1.1", | ||
"description": "gulp plugin to publish files to amazon s3", | ||
@@ -34,2 +34,3 @@ "keywords": [ | ||
"fancy-log": "^1.3.3", | ||
"lodash.chunk": "^4.2.0", | ||
"mime-types": "^2.1.21", | ||
@@ -36,0 +37,0 @@ "pad-component": "^0.0.1", |
@@ -100,3 +100,3 @@ # gulp-awspublish | ||
If you are receiving "Access Denied" message, verify that public access to the bucket is **not blocked**. The following permissions are known to be working: | ||
By default, the plugin works only when public access to the bucket is **not blocked**: | ||
@@ -109,2 +109,9 @@ - Block all public access: **Off** | ||
When dealing with a private bucket, make sure to pass the option `{ noAcl: true }` or a value for the `x-amz-acl` header: | ||
```js | ||
publisher.publish({}, { noAcl: true }); | ||
publisher.publish({ "x-amz-acl": "something" }); | ||
``` | ||
## Testing | ||
@@ -111,0 +118,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
29257
461
369
11
+ Addedlodash.chunk@^4.2.0
+ Addedlodash.chunk@4.2.0(transitive)