Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@ Lambda.prototype._zipfileTmpPath = function (program) {
};

Lambda.prototype._rsync = function (program, codeDirectory, callback) {
var excludes = ['.git*', '*.swp', '.editorconfig', 'deploy.env', '*.log', 'node_modules'],
excludeArgs = '';
var excludes = ['.git*', '*.swp', '.editorconfig', 'deploy.env', '*.log', 'build/'],
excludeGlobs = [];
if (program.excludeGlobs) {
var excludeGlobs = program.excludeGlobs.split(' ');
excludeArgs = excludeGlobs.concat(excludes).map(function(exclude) {
return '--exclude=' + exclude;
}).join(' ');
excludeGlobs = program.excludeGlobs.split(' ');
}
var excludeArgs = excludeGlobs.concat(excludes).map(function(exclude) {
return '--exclude=' + exclude;
}).join(' ');

exec('mkdir -p ' + codeDirectory, function(err) {
if (err) {
Expand Down Expand Up @@ -335,12 +335,12 @@ Lambda.prototype._archive = function (program, archive_callback) {
var _this = this;
var codeDirectory = _this._codeDirectory(program);

console.log('=> Moving files to temporary directory');
// Move all files to tmp folder (except .git, .log, event.json and node_modules)
_this._cleanDirectory(codeDirectory, function(err) {
if (err) {
return archive_callback(err);
}
console.log('=> Moving files to temporary directory');
// Move files to tmp folder
_this._rsync(program, codeDirectory, function (err) {
if (err) {
return archive_callback(err);
Expand Down