Skip to content

Commit

Permalink
Merge pull request #50 from nibynool/bucket-prefix-slashes
Browse files Browse the repository at this point in the history
Detect slashes on bucketPrefix and fix as required
  • Loading branch information
k1LoW committed Feb 17, 2020
2 parents bb4eb4d + 5ca4240 commit da45d0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ class ServerlessS3Sync {
const servicePath = this.servicePath;
const promises = s3Sync.map( async (s) => {
let bucketPrefix = '';
if (s.hasOwnProperty('bucketPrefix')) {
bucketPrefix = s.bucketPrefix;
if (s.hasOwnProperty('bucketPrefix') && s.bucketPrefix.length > 0) {
bucketPrefix = s.bucketPrefix.replace(/\/?$/, '').replace(/^\/?/, '/')
}
let acl = 'private';
if (s.hasOwnProperty('acl')) {
Expand Down

0 comments on commit da45d0e

Please sign in to comment.