8000 Private module fix by DeviaVir · Pull Request #73 · motdotla/node-lambda · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
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
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true

[*]

# Change these settings to your own preference
indent_style = space
indent_size = 2

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
11 changes: 8 additions & 3 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,22 @@ Lambda.prototype._zipfileTmpPath = function (program) {
};

Lambda.prototype._rsync = function (program, codeDirectory, callback) {
var excludes = [ '.git*', 'deploy.env', '*.log', 'node_modules', 'test' ];
var excludes = [ '.git*', '.editorconfig', 'deploy.env', '*.log', 'node_modules', 'test' ];
if (program.packageDirectory) {
excludes.push(program.packageDirectory);
}
var excludeArgs = excludes.map(function(exclude) { return '--exclude=' + exclude; }).join(' ');
exec('rsync -r ' + excludeArgs + ' . ' + codeDirectory, function (err) {
exec('mkdir -p ' + codeDirectory, function(err) {
if (err) {
return callback(err);
}
exec('rsync -r ' + excludeArgs + ' . ' + codeDirectory, function (err) {
if (err) {
return callback(err);
}

return callback(null, true);
return callback(null, true);
});
});
};

Expand Down
0