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

lambda_package fix copy zipfile to distribution folder #16

Merged
merged 2 commits into from
Jun 28, 2015
Merged
Changes from 1 commit
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
Next Next commit
lambda_package fix copy zipfile to distribution folder
  • Loading branch information
qen committed Jun 23, 2015
commit f41417b4ca714409af23f02ddcf92ed9fd4ecb6d
22 changes: 14 additions & 8 deletions tasks/lambda_package.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,24 @@ module.exports = function (grunt) {

output.on('close', function () {
mkdirp('./' + options.dist_folder, function (err) {
fs.createReadStream(install_location + '/' + archive_name + '.zip').pipe(
fs.createWriteStream('./' + options.dist_folder + '/' + archive_name + '.zip')
);

rimraf(install_location, function () {
var dist_zip = fs.createWriteStream('./' + options.dist_folder + '/' + archive_name + '.zip');

grunt.config.set('lambda_deploy.' + task.target + '.package',
'./' + options.dist_folder + '/' + archive_name + '.zip');
fs.createReadStream(install_location + '/' + archive_name + '.zip').pipe(dist_zip);

dist_zip.on('close', function () {

rimraf(install_location, function () {

grunt.config.set('lambda_deploy.' + task.target + '.package',
'./' + options.dist_folder + '/' + archive_name + '.zip');

grunt.log.writeln('Created package at ' + options.dist_folder + '/' + archive_name + '.zip');
done(true);
});

grunt.log.writeln('Created package at ' + options.dist_folder + '/' + archive_name + '.zip');
done(true);
});

});
});
});
Expand Down