]> git.basschouten.com Git - pithrottler.git/commitdiff
Fix bug in update code.
authorBas Schouten <bas@basschouten.com>
Mon, 22 Apr 2024 09:34:13 +0000 (10:34 +0100)
committerBas Schouten <bas@basschouten.com>
Mon, 22 Apr 2024 09:34:13 +0000 (10:34 +0100)
pithrottler.js

index bef8773986ae9599c8ae9f493524d4df1e9ea750..175bc69c1aef79bc3aac16012f2caa9f663e6581 100644 (file)
@@ -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");\r
+        if (remoteRevision != stdout.substring(0, 40)) {
+          res.end("1");
         } else {
-          res.end("0");\r
+          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");\r
+        res.end("Done");
     });
     return;
   }