[Pkg-javascript-commits] [node-coveralls] 132/332: Fixing existsSync issues for older versions of node

Bastien Roucariès rouca at moszumanska.debian.org
Thu Nov 9 13:53:50 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 f9dd7a16c1b92d167a9954525fa9eb36abe2cee2
Author: Jonathan Kingston <jonathan at jooped.co.uk>
Date:   Fri Jan 31 21:39:47 2014 +0000

    Fixing existsSync issues for older versions of node
---
 lib/detectLocalGit.js | 3 ++-
 test/getOptions.js    | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/detectLocalGit.js b/lib/detectLocalGit.js
index 4fd8d1b..3d381db 100644
--- a/lib/detectLocalGit.js
+++ b/lib/detectLocalGit.js
@@ -7,7 +7,8 @@ module.exports = function detectLocalGit(knownCommit, knownBranch) {
   var dir = process.cwd(), gitDir;
   while ('/' !== dir) {
     gitDir = path.join(dir, '.git');
-    if (fs.existsSync(path.join(gitDir, 'HEAD')))
+    var existsSync = fs.existsSync || path.existsSync;
+    if (existsSync(path.join(gitDir, 'HEAD')))
       break;
 
     dir = path.dirname(dir);
diff --git a/test/getOptions.js b/test/getOptions.js
index 0639a3c..f9b2494 100644
--- a/test/getOptions.js
+++ b/test/getOptions.js
@@ -303,7 +303,8 @@ function ensureLocalGitContext(options) {
   var baseDir = process.cwd(), dir = baseDir, gitDir;
   while ('/' !== dir) {
     gitDir = path.join(dir, '.git');
-    if (fs.existsSync(path.join(gitDir, 'HEAD')))
+    var existsSync = fs.existsSync || path.existsSync;
+    if (existsSync(path.join(gitDir, 'HEAD')))
       break;
 
     dir = path.dirname(dir);

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