|
|
@ -6,16 +6,21 @@ var fs = require('fs'), |
|
|
|
statusProcessor = require('../lib/status-processor'); |
|
|
|
statusProcessor = require('../lib/status-processor'); |
|
|
|
|
|
|
|
|
|
|
|
var parseOptionsFromReferer = function (path, callback) { |
|
|
|
var parseOptionsFromReferer = function (path, callback) { |
|
|
|
var pathParts = path.split("/"); |
|
|
|
var pathParts = path.split("/").filter(function (value) { return value; }); |
|
|
|
var result = {}; |
|
|
|
var result = {}; |
|
|
|
if (pathParts.length < 3) { |
|
|
|
|
|
|
|
|
|
|
|
if (pathParts.length < 2) { |
|
|
|
return callback("BadRequest", result); |
|
|
|
return callback("BadRequest", result); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
result.owner = pathParts[1]; |
|
|
|
if (pathParts[2] == "tree") { |
|
|
|
result.reponame = pathParts[2]; |
|
|
|
pathParts.splice(2, 1); |
|
|
|
result.branchName = pathParts[3]; |
|
|
|
} |
|
|
|
result.rev = pathParts[4]; |
|
|
|
|
|
|
|
|
|
|
|
result.owner = pathParts[0]; |
|
|
|
|
|
|
|
result.reponame = pathParts[1]; |
|
|
|
|
|
|
|
result.branchName = pathParts[2]; |
|
|
|
|
|
|
|
result.rev = pathParts[3]; |
|
|
|
return callback(null, result); |
|
|
|
return callback(null, result); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|