Permalink
Browse files

Use `fs.realpath` userland module

This makes glob work on Node 6.  Also adds v6 to travis-ci config.

Close #258
Close #259
  • Loading branch information...
1 parent 68f2509 commit 1d4ef301f0a22fb6c33c3f8bbb2ca9bb6bb6c172 @isaacs committed Jun 16, 2016
Showing with 6 additions and 2 deletions.
  1. +1 −0 .travis.yml
  2. +2 −1 glob.js
  3. +1 −0 package.json
  4. +2 −1 sync.js
View
@@ -5,3 +5,4 @@ node_js:
- '0.12'
- '4'
- '5'
+ - '6'
View
@@ -41,6 +41,7 @@
module.exports = glob
var fs = require('fs')
+var rp = require('fs.realpath')
var minimatch = require('minimatch')
var Minimatch = minimatch.Minimatch
var inherits = require('inherits')
@@ -232,7 +233,7 @@ Glob.prototype._realpathSet = function (index, cb) {
// one or more of the links in the realpath couldn't be
// resolved. just return the abs value in that case.
p = self._makeAbs(p)
- fs.realpath(p, self.realpathCache, function (er, real) {
+ rp.realpath(p, self.realpathCache, function (er, real) {
if (!er)
set[real] = true
else if (er.syscall === 'stat')
View
@@ -17,6 +17,7 @@
"node": "*"
},
"dependencies": {
+ "fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "2 || 3",
View
@@ -2,6 +2,7 @@ module.exports = globSync
globSync.GlobSync = GlobSync
var fs = require('fs')
+var rp = require('fs.realpath')
var minimatch = require('minimatch')
var Minimatch = minimatch.Minimatch
var Glob = require('./glob.js').Glob
@@ -57,7 +58,7 @@ GlobSync.prototype._finish = function () {
for (var p in matchset) {
try {
p = self._makeAbs(p)
- var real = fs.realpathSync(p, self.realpathCache)
+ var real = rp.realpathSync(p, self.realpathCache)
set[real] = true
} catch (er) {
if (er.syscall === 'stat')

0 comments on commit 1d4ef30

Please sign in to comment.