aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGregg Caines <[email protected]>2013-05-24 12:24:23 -0700
committerGregg Caines <[email protected]>2013-05-24 12:24:23 -0700
commit29f931cfe72191cb9b568b821dee3c2ab4725c1b (patch)
tree22b8116ee64fb5335076aae87cb074433e145ae4 /lib
parented578c2d1944c7122a5b1bbde0622513dcf87cc2 (diff)
parentebca6c04edd9952c1c3fb99aea019e385a4c53b8 (diff)
downloadnode-coveralls-29f931cfe72191cb9b568b821dee3c2ab4725c1b.tar.xz
node-coveralls-29f931cfe72191cb9b568b821dee3c2ab4725c1b.zip
Merge pull request #6 from elliottcable/command-line-usage
Support usage from the command-line
Diffstat (limited to 'lib')
-rw-r--r--lib/convertLcovToCoveralls.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/convertLcovToCoveralls.js b/lib/convertLcovToCoveralls.js
index f407893..2b5e223 100644
--- a/lib/convertLcovToCoveralls.js
+++ b/lib/convertLcovToCoveralls.js
@@ -25,7 +25,7 @@ var convertLcovFileObject = function(file, filepath){
coverage : coverage };
};
-var convertLcovToCoveralls = function(input, filepath, cb){
+var convertLcovToCoveralls = function(input, filepath, repo_token, cb){
console.log("in: ", filepath);
if (filepath[0] !== '/'){
filepath = path.join(process.cwd(), filepath);
@@ -33,10 +33,14 @@ var convertLcovToCoveralls = function(input, filepath, cb){
lcovParse(input, function(err, parsed){
if (err){ return cb(err); }
var postJson = {
- service_job_id : TRAVIS_JOB_ID,
- service_name : "travis-ci",
source_files : []
};
+ if (typeof repo_token !== "undefined" && repo_token !== null) {
+ postJson.repo_token = repo_token;
+ } else {
+ postJson.service_job_id = TRAVIS_JOB_ID;
+ postJson.service_name = 'travis-ci';
+ }
parsed.forEach(function(file){
postJson.source_files.push(convertLcovFileObject(file, filepath));
});