FunctionDeploy: Create distribution directory in path so that package in project's package.json can be used for build operations

This commit is contained in:
Austen Collins 2016-01-29 17:55:58 -08:00
parent b7a302e6a3
commit ab2b67e5d5
2 changed files with 8 additions and 3 deletions

View File

@ -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;
}

View File

@ -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();
}