diff options
| author | cainus <[email protected]> | 2013-03-28 00:39:20 -0700 |
|---|---|---|
| committer | cainus <[email protected]> | 2013-03-28 00:39:20 -0700 |
| commit | 7e3b06ea7ab092ffb9fb75d94fefc5f31a6925b7 (patch) | |
| tree | f78ba1b2c09f0865f78ee5d19f7f12b6f0d52f70 /lib | |
| parent | f27d2ec87c5ce5606cc01839ad056b5b1a4ae7a2 (diff) | |
| download | node-coveralls-7e3b06ea7ab092ffb9fb75d94fefc5f31a6925b7.tar.xz node-coveralls-7e3b06ea7ab092ffb9fb75d94fefc5f31a6925b7.zip | |
fix pathing issues?
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/convertLcovToCoveralls.js | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/convertLcovToCoveralls.js b/lib/convertLcovToCoveralls.js index dfc467c..c390aab 100644 --- a/lib/convertLcovToCoveralls.js +++ b/lib/convertLcovToCoveralls.js @@ -1,6 +1,7 @@ var TRAVIS_JOB_ID = process.env.TRAVIS_JOB_ID || 'unknown'; var fs = require('fs'); var lcovParse = require('./parser'); +var path = require('path'); var detailsToCoverage = function(length, details){ var coverage = new Array(length); @@ -11,8 +12,8 @@ var detailsToCoverage = function(length, details){ }; var convertLcovFileObject = function(file, filepath){ - var path = filepath + "/" + file.file; - var source = fs.readFileSync(path, 'utf8'); + var fullpath = path.join(filepath, file.file); + var source = fs.readFileSync(fullpath, 'utf8'); var lines = source.split("\n"); var coverage = detailsToCoverage(lines.length, file.lines.details); return { name : file.file, @@ -23,13 +24,8 @@ var convertLcovFileObject = function(file, filepath){ var convertLcovToCoveralls = function(input, filepath){ console.log("in: ", filepath); if (filepath[0] !== '/'){ - filepath = process.cwd() + '/' + filepath; + filepath = path.join(process.cwd(), filepath); } - console.log("now: ", filepath); - if (filepath[filepath.length - 1] !== '/'){ - filepath = filepath + '/'; - } - console.log("abs: ", filepath); var parsed = lcovParse(input); var postJson = { service_job_id : TRAVIS_JOB_ID, |
