aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGregg Caines <[email protected]>2013-04-15 11:50:27 -0700
committerGregg Caines <[email protected]>2013-04-15 11:50:27 -0700
commit6b6b66217f92bb259e795ace6aab3f531ad25e41 (patch)
tree6b2dd7ed55bd922bb5e2f9bda37007744ab012f1 /lib
parent1f33a2d0997c49ae533ccfee3b2aa9fe8cd31c90 (diff)
parent40dd222e351c05cf38ae613d516c6d9a1128829c (diff)
downloadnode-coveralls-6b6b66217f92bb259e795ace6aab3f531ad25e41.tar.xz
node-coveralls-6b6b66217f92bb259e795ace6aab3f531ad25e41.zip
Merge pull request #4 from deepsweet/master
check if file path is already absoluted
Diffstat (limited to 'lib')
-rw-r--r--lib/convertLcovToCoveralls.js8
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,