[Pkg-javascript-commits] [node-coveralls] 12/332: fix pathing issues?

Bastien Roucariès rouca at moszumanska.debian.org
Thu Nov 9 13:53:33 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 7e3b06ea7ab092ffb9fb75d94fefc5f31a6925b7
Author: cainus <gregg at caines.ca>
Date:   Thu Mar 28 00:39:20 2013 -0700

    fix pathing issues?
---
 lib/convertLcovToCoveralls.js | 12 ++++--------
 package.json                  |  2 +-
 2 files changed, 5 insertions(+), 9 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,
diff --git a/package.json b/package.json
index 01fcaed..8c36330 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
       "name": "coveralls",
       "description" : "takes json-cov output into stdin and POSTs to coveralls.io",
       "keywords" : ["coverage", "coveralls"], 
-      "version": "2.0.1",
+      "version": "2.0.2",
       "bugs": {
        "url": "https://github.com/cainus/node-coveralls/issues"
       },

-- 
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