Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix: excludes #91

Merged
merged 10 commits into from
Apr 22, 2016
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