From cd7132d8898eb16610c1a58a682e5a1c50646eee Mon Sep 17 00:00:00 2001 From: dsc Date: Wed, 29 Feb 2012 17:08:29 -0800 Subject: [PATCH] Return the plaintext result of the git pull command to the webhook caller. --- lib/server/server.co | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/server/server.co b/lib/server/server.co index 7532b68..c44887d 100755 --- a/lib/server/server.co +++ b/lib/server/server.co @@ -195,12 +195,14 @@ app.all '/webhook/post-update', (req, res) -> # exec the pull async... console.log '[/webhook/post-update] $ git pull origin master' child = exec 'git pull origin master', (err, stdout, stderr) -> + res.contentType '.txt' console.log '[/webhook/post-update] ', stdout console.log '[/webhook/post-update] ', stderr - console.error '[/webhook/post-update] ERROR!', err if err - - # ...but return ok to caller right away - res.send 'ok!', 200 + if err + console.error '[/webhook/post-update] ERROR!', err + res.send "#stdout\n\n#stderr\n\nERROR! #err", 503 + else + res.send "#stdout\n\n#stderr", 200 -- 1.7.0.4