mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
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:
parent
b7a302e6a3
commit
ab2b67e5d5
@ -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;
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user