diff options
| author | deepsweet <[email protected]> | 2013-04-15 21:08:13 +0300 |
|---|---|---|
| committer | deepsweet <[email protected]> | 2013-04-15 21:08:13 +0300 |
| commit | 40dd222e351c05cf38ae613d516c6d9a1128829c (patch) | |
| tree | 6b2dd7ed55bd922bb5e2f9bda37007744ab012f1 | |
| parent | 1f33a2d0997c49ae533ccfee3b2aa9fe8cd31c90 (diff) | |
| download | node-coveralls-40dd222e351c05cf38ae613d516c6d9a1128829c.tar.xz node-coveralls-40dd222e351c05cf38ae613d516c6d9a1128829c.zip | |
check if file path is already absoluted
| -rw-r--r-- | lib/convertLcovToCoveralls.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/convertLcovToCoveralls.js b/lib/convertLcovToCoveralls.js index d05056d..f407893 100644 --- a/lib/convertLcovToCoveralls.js +++ b/lib/convertLcovToCoveralls.js @@ -12,8 +12,12 @@ var detailsToCoverage = function(length, details){ }; var convertLcovFileObject = function(file, filepath){ - var fullpath = path.join(filepath, file.file); - var source = fs.readFileSync(fullpath, 'utf8'); + if (file.file[0] !== '/'){ + filepath = path.join(filepath, file.file); + } else { + filepath = file.file; + } + var source = fs.readFileSync(filepath, 'utf8'); var lines = source.split("\n"); var coverage = detailsToCoverage(lines.length, file.lines.details); return { name : file.file, |
