From 0200c10e1bebdadf0da342e7663211b65a70a75f Mon Sep 17 00:00:00 2001 From: Djkato Date: Wed, 8 Feb 2023 18:24:40 +0100 Subject: [PATCH] fix webhook --- git_webhook.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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'") } })