diff --git a/lib/main.js b/lib/main.js index 72f5211c..d43954f0 100644 --- a/lib/main.js +++ b/lib/main.js @@ -96,7 +96,7 @@ Lambda.prototype._runHandler = function (handler, event, program, context) { return timeout - (currentTime - startTime); }; - switch(runtime) { + switch(program.runtime) { case "nodejs": handler(event, context); break; @@ -469,7 +469,7 @@ Lambda.prototype.package = function (program) { }); }; -Lambda.prototype.deploy = function (program) { +Lambda.prototype.deploy = function (program, callback) { var _this = this; var regions = program.region.split(','); _this._archive(program, function (err, buffer) { @@ -517,11 +517,8 @@ Lambda.prototype.deploy = function (program) { return _this._uploadExisting(lambda, params, cb); }); }, function (err, results) { - if (err) { - throw err; - } else { - console.log('=> Zip file(s) done uploading. Results follow: '); - console.log(results); + if(callback !== undefined) { + callback(err, results); } }); });