Skip to content

Commit

Permalink
Breaking: Remove path normalization (closes #79)
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Feb 21, 2017
1 parent 64eb8b2 commit 3bb9069
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 125 deletions.
21 changes: 4 additions & 17 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ var unique = require('unique-stream');

var glob = require('glob');
var pumpify = require('pumpify');
var resolveGlob = require('to-absolute-glob');
var isNegatedGlob = require('is-negated-glob');
var globParent = require('glob-parent');
var path = require('path');
var resolveGlob = require('to-absolute-glob');
var extend = require('extend');
var sepRe = (process.platform === 'win32' ? /[\/\\]/ : /\/+/);
var removeTrailingSeparator = require('remove-trailing-separator');

function globStream(globs, opt) {
if (!opt) {
Expand Down Expand Up @@ -137,7 +136,7 @@ function createStream(ourGlob, negatives, opt) {
stream.write({
cwd: opt.cwd,
base: basePath,
path: path.normalize(filename),
path: removeTrailingSeparator(filename),
});
});
return stream;
Expand Down Expand Up @@ -165,19 +164,7 @@ function globIsSingular(glob) {
}

function getBasePath(ourGlob, opt) {
var basePath;
var parent = globParent(ourGlob);

if (parent === '/' && opt && opt.root) {
basePath = path.normalize(opt.root);
} else {
basePath = resolveGlob(parent, opt);
}

if (!sepRe.test(basePath.charAt(basePath.length - 1))) {
basePath += path.sep;
}
return basePath;
return globParent(resolveGlob(ourGlob, opt));
}

module.exports = globStream;
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
},
"dependencies": {
"extend": "^3.0.0",
"glob": "^7.0.6",
"glob": "^7.1.1",
"glob-parent": "^3.0.0",
"is-negated-glob": "^1.0.0",
"ordered-read-streams": "^0.3.0",
"pumpify": "^1.3.5",
"remove-trailing-separator": "^1.0.1",
"through2": "^0.6.0",
"to-absolute-glob": "^0.1.1",
"to-absolute-glob": "^2.0.0",
"unique-stream": "^2.0.2"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit 3bb9069

Please sign in to comment.