Skip to content
Permalink
Browse files

Fix: Fix path errors in windows (fixes #4888)

  • Loading branch information...
gyandeeps committed Jan 8, 2016
1 parent 1972678 commit 7c9be60b17757f1c007d87aa05d0c4764c8e4aad
Showing with 4 additions and 4 deletions.
  1. +1 −1 lib/cli-engine.js
  2. +2 −2 lib/ignored-paths.js
  3. +1 −1 tests/lib/cli-engine.js
@@ -553,7 +553,7 @@ CLIEngine.prototype = {

var cwd = options.cwd || process.cwd;
patterns = this.resolveFileGlobPatterns(patterns.map(function(pattern) {
if (pattern.indexOf("/") !== 0) {
if (pattern.indexOf("/") > 0) {
return path.join(cwd, pattern);
}
return pattern;
@@ -59,7 +59,7 @@ function findIgnoreFile(cwd) {
* @returns {string} Normalized filepath
*/
function normalizeFilepath(filepath) {
filepath = filepath.replace("\\", "/");
filepath = filepath.replace(/\\/g, "/");
filepath = filepath.replace(/^\.\//, "");
return filepath;
}
@@ -86,7 +86,7 @@ function removePrefixFromFilepath(filepath, prefix) {
*/
function resolveFilepath(filepath, baseDir) {
if (baseDir) {
var base = path.resolve(baseDir);
var base = normalizeFilepath(path.resolve(baseDir));
filepath = removePrefixFromFilepath(filepath, base);
filepath = removePrefixFromFilepath(filepath, fs.realpathSync(base));
}
@@ -828,7 +828,7 @@ describe("CLIEngine", function() {
}
});

var report = engine.executeOnFiles([fixtureDir + "/fixmode"]);
var report = engine.executeOnFiles([path.resolve(fixtureDir, fixtureDir + "/fixmode")]);
report.results.forEach(convertCRLF);
assert.deepEqual(report, {
"results": [

0 comments on commit 7c9be60

Please sign in to comment.
You can’t perform that action at this time.