Skip to content

Commit

Permalink
added config to include hidden folders in the S3 upload
Browse files Browse the repository at this point in the history
  • Loading branch information
habdelra committed Sep 10, 2016
1 parent 71e84e1 commit b1bcb31
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ The list of built project files. This option should be relative to `distDir` and

*Default:* `context.distFiles`

### dotFolders

This is a boolean that can be set to `true` to include hidden folders
(that are prefixed with a `.`) as folders that can be uploaded to S3.

*Default:* `false`

### gzippedFiles

The list of files that have been gziped. This option should be relative to `distDir`. By default, this option will use the `gzippedFiles` property of the deployment context, provided by [ember-cli-deploy-gzip][3].
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module.exports = {
acl: 'public-read',
cacheControl: 'max-age='+TWO_YEAR_CACHE_PERIOD_IN_SEC+', public',
expires: EXPIRE_IN_2030,
dotFolders: false,
distDir: function(context) {
return context.distDir;
},
Expand Down Expand Up @@ -55,8 +56,9 @@ module.exports = {
var manifestPath = this.readConfig('manifestPath');
var cacheControl = this.readConfig('cacheControl');
var expires = this.readConfig('expires');
var dotFolders = this.readConfig('dotFolders');

var filesToUpload = distFiles.filter(minimatch.filter(filePattern, { matchBase: true }));
var filesToUpload = distFiles.filter(minimatch.filter(filePattern, { matchBase: true, dot: dotFolders }));

var s3 = this.readConfig('uploadClient') || new S3({
plugin: this
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/index-nodetest.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ describe('s3 plugin', function() {
return previous;
}, []);

assert.equal(messages.length, 4);
assert.equal(messages.length, 5);
});

describe('required config', function() {
Expand Down

2 comments on commit b1bcb31

@blimmer
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@habdelra just wanted to say "thanks!" for adding the functionality. I had to add a .well-known folder today and this made it extremely easy. 🍻

@habdelra
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure thing!

Please sign in to comment.