diff --git a/index.js b/index.js index 8f88b68..e5fad86 100644 --- a/index.js +++ b/index.js @@ -31,9 +31,9 @@ getConfig(function (config) { console.log('Valid payload! Running commands'); - deployTasks.run(function () { - res.status(200).send(); - }); + res.status(200).send(); + + deployTasks.run(); } else { // if other branches were updated, send 200 only to make github happy... diff --git a/lib/deployTasks.js b/lib/deployTasks.js index 28d94d2..23c2344 100644 --- a/lib/deployTasks.js +++ b/lib/deployTasks.js @@ -34,7 +34,7 @@ var async = require('async'), } } - deployTasks.run = function (cb) { + deployTasks.run = function () { if (!initConfigCalled) { throw new Error('You should call initConfig first'); } @@ -45,8 +45,7 @@ var async = require('async'), deployTasks.commandFactory(stopCmd), deployTasks.commandFactory(updateCmd), deployTasks.commandFactory(postUpdateCmd), - deployTasks.commandFactory(startCmd), - cb + deployTasks.commandFactory(startCmd) ]); }; })(); diff --git a/package.json b/package.json index 00e527c..a2722d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "github-webhooks-listener", - "version": "0.2.0", + "version": "0.2.1", "description": "A module to listen to github hooks and to update and deploy project when push event occurs", "main": "index.js", "scripts": {