Comparing version 0.5.2 to 0.5.3
{ | ||
"name": "grunt-aws", | ||
"description": "A Grunt interface into the Amazon Node.JS SDK", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"homepage": "https://github.com/jpillora/grunt-aws", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -165,3 +165,3 @@ # grunt-aws | ||
* `ContentEncoding` | ||
* `CacheControl` (converts numbers into strings as `max-age=<num>, public`) | ||
* `CacheControl` (accepts a string or converts numbers into header as `max-age=<num>, public`) | ||
* `Expires` (converts dates to strings with `toUTCString()`) | ||
@@ -317,2 +317,12 @@ * `GrantFullControl` | ||
//upload the public/ folder with a custom Cache-control header | ||
longTym: { | ||
options: { | ||
headers: { | ||
CacheControl: 'max-age=900, public, must-revalidate' | ||
} | ||
} | ||
src: "public/**" | ||
}, | ||
//upload the public/ folder with a 2 year cache time | ||
@@ -327,2 +337,3 @@ longTym: { | ||
}, | ||
//upload the public/ folder with a specific expiry date | ||
@@ -329,0 +340,0 @@ beryLongTym: { |
@@ -51,5 +51,2 @@ var AWS = require("aws-sdk"), | ||
if(!files.length) | ||
return grunt.log.ok("No files matched"); | ||
//mark as async | ||
@@ -170,6 +167,7 @@ var done = this.async(); | ||
if(!opts.cache) | ||
if(!opts.cache && files.length) | ||
subtasks.push(getFileList); | ||
subtasks.push(copyAllFiles); | ||
if(files.length) | ||
subtasks.push(copyAllFiles); | ||
@@ -217,8 +215,14 @@ //start! | ||
function enableWebHosting(callback) { | ||
var defaultWebOptions = { | ||
"grunt-overwrite": false, | ||
IndexDocument: { Suffix : 'index.html' } | ||
}; | ||
var webOptions = _.isObject(opts.enableWeb) ? opts.enableWeb : defaultWebOptions; | ||
S3.getBucketWebsite({ Bucket:opts.bucket }, function(err){ | ||
if (err && err.name === 'NoSuchWebsiteConfiguration'){ | ||
if ((err && err.name === 'NoSuchWebsiteConfiguration') || webOptions["grunt-overwrite"]){ | ||
delete webOptions["grunt-overwrite"]; | ||
//opts.enableWeb can be the params for WebsiteRedirectLocation. | ||
//Otherwise, just set the index.html as default suffix | ||
grunt.log.writeln('Enabling website configuration on ' + opts.bucket + '...'); | ||
var webOptions = _.isObject(opts.enableWeb) ? opts.enableWeb : { IndexDocument: { Suffix : 'index.html' }}; | ||
if (opts.dryRun) return callback(); | ||
@@ -225,0 +229,0 @@ S3.putBucketWebsite({ |
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
34768
620
528