diff --git a/git_webhook.js b/git_webhook.js index 7972cb3..282b60e 100644 --- a/git_webhook.js +++ b/git_webhook.js @@ -9,8 +9,8 @@ http.createServer(function (req, res) { req.on('data', function (chunk) { let sig = "sha1=" + crypto.createHmac('sha1', secret).update(chunk.toString()).digest('hex') - if (req.headers['x-hub-signature'] == sig) { - exec('cd ' + repo + ' && git pull' + '&& npm install' + 'pm2 restart 0') + if (req.headers["x-hub-signature"] == sig) { + exec("pm2 stop 'MOOver - main' && " + " cd " + repo + "&& git pull" + " && npm install" + " pm2 start 'MOOver - main'") } })