From a95d434d4ed73fac3744ef22dc739fe58f157cbf Mon Sep 17 00:00:00 2001 From: ac360 Date: Wed, 10 Feb 2016 14:41:42 -0800 Subject: [PATCH] ServerlessMeta: skip over hidden files when loading #578 --- lib/ServerlessMeta.js | 3 +++ tests/tests/actions/FunctionDeploy.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ServerlessMeta.js b/lib/ServerlessMeta.js index af4a3c8f3..1a39e12ef 100644 --- a/lib/ServerlessMeta.js +++ b/lib/ServerlessMeta.js @@ -49,6 +49,9 @@ class ServerlessMeta for (let i = 0; i < variableFiles.length; i++) { + // Skip unrelated and hidden files + if (!variableFiles[i] || variableFiles[i].charAt(0) === '.' || variableFiles[i].indexOf('s-variables') == -1) continue; + let variableFile = SUtils.readAndParseJsonSync(path.join(_this._S.config.projectPath, '_meta', 'variables', variableFiles[i])); // Parse file name to get stage/region diff --git a/tests/tests/actions/FunctionDeploy.js b/tests/tests/actions/FunctionDeploy.js index 1cecc1fa2..3d2c3f33d 100644 --- a/tests/tests/actions/FunctionDeploy.js +++ b/tests/tests/actions/FunctionDeploy.js @@ -121,7 +121,7 @@ describe('Test Action: Function Deploy', function() { }); }); - describe('Function Deploy: Nested W/ Name Template', function() { + describe('Function Deploy: Nested W/ Custom Name', function() { it('should deploy functions', function(done) { this.timeout(0);