diff --git a/lib/actions/CodePackageLambda.js b/lib/actions/CodePackageLambda.js index 869c6d4b5..9e0ff1df8 100644 --- a/lib/actions/CodePackageLambda.js +++ b/lib/actions/CodePackageLambda.js @@ -138,9 +138,9 @@ module.exports = function(SPlugin, serverlessPath) { let _this = this; - // Create dist folder + // Set Dist Dir let d = new Date(); - _this.pathDist = path.join(os.tmpdir(), _this.function.name + '@' + d.getTime()); + _this.pathDist = path.join(_this.S.config.projectPath, '_meta', '_tmp', _this.function.name + '@' + d.getTime()); // Status SUtils.sDebug(`"${_this.evt.options.stage} - ${_this.evt.options.region} - ${_this.function.name}": Copying in dist dir ${_this.pathDist}`); @@ -153,7 +153,7 @@ module.exports = function(SPlugin, serverlessPath) { _this.pathDist, { exclude: function(name, prefix) { - console.log(name); + if (!excludePatterns.length) { return false; } diff --git a/lib/actions/FunctionDeploy.js b/lib/actions/FunctionDeploy.js index 4a911cef2..d5fd0e2e2 100644 --- a/lib/actions/FunctionDeploy.js +++ b/lib/actions/FunctionDeploy.js @@ -208,6 +208,11 @@ module.exports = function(SPlugin, serverlessPath) { _this.evt.options.paths = _this.S.state.getFunctions({ returnPaths: true }); } + // Ensure tmp folder exists in _meta + if (!SUtils.dirExistsSync(path.join(_this.S.config.projectPath, '_meta', '_tmp'))) { + fs.mkdirSync(path.join(_this.S.config.projectPath, '_meta', '_tmp')); + } + return BbPromise.resolve(); }