diff options
| author | elliottcable <[email protected]> | 2013-05-24 02:42:15 -0400 |
|---|---|---|
| committer | elliottcable <[email protected]> | 2013-05-24 02:42:15 -0400 |
| commit | 92783b483630b516b83cab3b555cce2fb5b79982 (patch) | |
| tree | 2b7c224fd47b0e778992714c5a0432b3ea16d373 /lib | |
| parent | ed578c2d1944c7122a5b1bbde0622513dcf87cc2 (diff) | |
| download | node-coveralls-92783b483630b516b83cab3b555cce2fb5b79982.tar.xz node-coveralls-92783b483630b516b83cab3b555cce2fb5b79982.zip | |
Supporting command-line usage outside of Travis-CI
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/convertLcovToCoveralls.js | 10 |
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)); }); |
