Skip to content

Commit

Permalink
Merge pull request #746 from Martii/webhookTesting001
Browse files Browse the repository at this point in the history
Dump output of meta at this point for manual tracing

Auto-merge ... tested on dev and localpro for syntax issue but not current methodology ... flipping clone during this
  • Loading branch information
Martii committed Oct 5, 2015
2 parents 2027f14 + 3d87df3 commit db71ba7
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions libs/repoManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,27 @@ function fetchRaw(aHost, aPath, aCallback) {
port: 443,
path: aPath,
method: 'GET',
headers: { 'User-Agent': 'Node.js' }
headers: {
'User-Agent': 'Node.js'
}
};

var req = https.request(options,
function (aRes) {

if (isDbg) {
console.log(JSON.stringify(aRes, null, ' '));
}

var bufs = [];
if (aRes.statusCode !== 200) { console.log(aRes.statusCode); return aCallback([new Buffer('')]); }
if (aRes.statusCode !== 200) {
console.warn(aRes.statusCode);
return aCallback([new Buffer('')]);
}
else {
aRes.on('data', function (aData) { bufs.push(aData); });
aRes.on('data', function (aData) {
bufs.push(aData);
});
aRes.on('end', function () {
aCallback(bufs);
});
Expand Down Expand Up @@ -109,6 +121,11 @@ RepoManager.prototype.loadScripts = function (aCallback, aUpdate) {
fetchRaw('raw.githubusercontent.com', url, function (aBufs) {
scriptStorage.getMeta(aBufs, function (aMeta) {
if (aMeta) {

if (isDbg) {
console.log(JSON.stringify(aMeta, null, ' '));
}

scriptStorage.storeScript(that.user, aMeta, Buffer.concat(aBufs),
aCallback, aUpdate);
}
Expand Down

0 comments on commit db71ba7

Please sign in to comment.