diff --git a/index.js b/index.js index ae31314..bde4eed 100644 --- a/index.js +++ b/index.js @@ -90,7 +90,7 @@ class ServerlessS3Sync { s.params.forEach((param) => { const glob = Object.keys(param)[0]; if(minimatch(localFile, `${path.resolve(localDir)}/${glob}`)) { - Object.assign(s3Params, param[glob] || {}); + Object.assign(s3Params, this.extractMetaParams(param) || {}); } }); } @@ -178,6 +178,15 @@ class ServerlessS3Sync { cli.consoleLog(`${messagePrefix}${chalk.yellow('Removed.')}`); }); } + + extractMetaParams(config) { + const validParams = {}; + const keys = Object.keys(config); + for (let i = 1; i < keys.length; i++) { + validParams[keys[i]] = config[keys[i]]; + } + return validParams; + } } module.exports = ServerlessS3Sync; diff --git a/package-lock.json b/package-lock.json index bdbb3c6..c8eafb3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "serverless-s3-sync", - "version": "1.8.0", + "version": "1.9.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5e8ebc9..84bbfbc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "serverless-s3-sync", - "version": "1.9.0", + "version": "1.9.1", "description": "A plugin to sync local directories and S3 prefixes for Serverless Framework.", "main": "index.js", "scripts": {