[Pkg-javascript-commits] [node-coveralls] 24/332: check if file path is already absoluted

Bastien Roucariès rouca at moszumanska.debian.org
Thu Nov 9 13:53:34 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-coveralls.

commit 40dd222e351c05cf38ae613d516c6d9a1128829c
Author: deepsweet <kir at soulshine.in>
Date:   Mon Apr 15 21:08:13 2013 +0300

    check if file path is already absoluted
---
 lib/convertLcovToCoveralls.js | 8 ++++++--
 1 file 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,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-coveralls.git



More information about the Pkg-javascript-commits mailing list