From 3c8058e08bb4ad298bfb305f1ec0695e107d509b Mon Sep 17 00:00:00 2001 From: Chase Sillevis Date: Mon, 11 Apr 2016 12:34:47 +0200 Subject: [PATCH] - Fix rsync namespaced error - Add editorconfig - Ignore editorconfig --- .editorconfig | 19 +++++++++++++++++++ lib/main.js | 11 ++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..a705a170 --- /dev/null +++ b/.editorconfig @@ -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 \ No newline at end of file diff --git a/lib/main.js b/lib/main.js index bf1c5d32..0e770c6c 100644 --- a/lib/main.js +++ b/lib/main.js @@ -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); + }); }); };