From 64b759fd83826d4cff56d330361eb1f31f431a1b Mon Sep 17 00:00:00 2001 From: Pierre-Yves Gerardy Date: Mon, 26 Dec 2016 11:02:41 +0100 Subject: [PATCH] [ospec] Speed up the CLI runner by skipping node_modules early --- ospec/bin/ospec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ospec/bin/ospec b/ospec/bin/ospec index 49b3ddc0..45c00a35 100644 --- a/ospec/bin/ospec +++ b/ospec/bin/ospec @@ -15,6 +15,7 @@ function traverseDirectory(pathname, callback) { if (err) reject(err) var promises = [] for (var i = 0; i < pathnames.length; i++) { + if (pathnames[i] === "node_modules") continue pathnames[i] = path.join(pathname, pathnames[i]) promises.push(traverseDirectory(pathnames[i], callback)) } @@ -31,7 +32,6 @@ function traverseDirectory(pathname, callback) { } traverseDirectory(".", function(pathname, stat, children) { - if (pathname.indexOf("node_modules") > -1) return if (pathname.match(/(?:^|\/)tests\/.*\.js$/)) { require(path.normalize(process.cwd()) + "/" + pathname) }