Merge pull request #1343 from isojs/fix-ignore-only-windows

Fix ignore/only on Windows
This commit is contained in:
Sebastian McKenzie 2015-04-24 15:21:33 +01:00
commit e330efe058
2 changed files with 4 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import * as babel from "../node";
import each from "lodash/collection/each";
import * as util from "../../util";
import fs from "fs";
import slash from "slash";
sourceMapSupport.install({
handleUncaughtExceptions: false,
@ -76,6 +77,7 @@ var compile = function (filename) {
};
var shouldIgnore = function (filename) {
filename = slash(filename);
return (ignoreRegex && ignoreRegex.test(filename)) || (onlyRegex && !onlyRegex.test(filename));
};

View File

@ -18,6 +18,7 @@ import each from "lodash/collection/each";
import has from "lodash/object/has";
import fs from "fs";
import * as t from "./types";
import slash from "slash";
export { inherits, inspect } from "util";
@ -94,6 +95,7 @@ export function booleanify(val: any): boolean {
}
export function shouldIgnore(filename, ignore, only) {
filename = slash(filename);
if (only.length) {
for (var i = 0; i < only.length; i++) {
if (only[i].test(filename)) return false;