From: Bas Schouten Date: Mon, 22 Apr 2024 09:34:13 +0000 (+0100) Subject: Fix bug in update code. X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=d9dd5927a9ea04f19e187cbe1f9d8443befba5a2;p=pithrottler.git Fix bug in update code. --- diff --git a/pithrottler.js b/pithrottler.js index bef8773..175bc69 100644 --- a/pithrottler.js +++ b/pithrottler.js @@ -16,12 +16,10 @@ const app = (req, res) => { exec('git ls-remote -q origin master', function (error, stdout, stderr) { let remoteRevision = stdout.substring(0, 40); exec('git rev-parse HEAD', function (error, stdout, stderr) { - console.log(remoteRevision); - console.log(stdout); - if (remoteRevision != stdout) { - res.end("1"); + if (remoteRevision != stdout.substring(0, 40)) { + res.end("1"); } else { - res.end("0"); + res.end("0"); } }); }); @@ -34,7 +32,7 @@ const app = (req, res) => { res.setHeader('Access-Control-Allow-Origin', '*'); exec('./install.sh', function (error, stdout, stderr) { - res.end("Done"); + res.end("Done"); }); return; }