Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement --watch #502

Closed
wants to merge 17 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
replace commondir by common-path-prefix
I wrote common-path-prefix without knowing of commondir (npm search FTW). It
explicitly excludes the base component so might be preferable over workarounds.
novemberborn committed Feb 8, 2016

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit bea1d84f5a93b5eb6249821dd2a71c1bcf3af621
8 changes: 2 additions & 6 deletions api.js
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ var figures = require('figures');
var globby = require('globby');
var chalk = require('chalk');
var objectAssign = require('object-assign');
var commondir = require('commondir');
var commonPathPrefix = require('common-path-prefix');
var resolveCwd = require('resolve-cwd');
var uniqueTempDir = require('unique-temp-dir');
var findCacheDir = require('find-cache-dir');
@@ -183,11 +183,7 @@ Api.prototype.run = function (files) {
self.options.cacheDir = cacheDir;
self.precompiler = new CachingPrecompiler(cacheDir);
self.fileCount = files.length;
if (self.fileCount === 1) {
self.base = path.relative('.', path.dirname(files[0])) + path.sep;
} else {
self.base = path.relative('.', commondir('.', files)) + path.sep;
}
self.base = path.relative('.', commonPathPrefix(files)) + path.sep;

var tests = files.map(self._runFile);

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@
"chokidar": "^1.4.2",
"cli-cursor": "^1.0.2",
"co-with-promise": "^4.6.0",
"commondir": "^1.0.1",
"common-path-prefix": "^1.0.0",
"convert-source-map": "^1.1.2",
"core-assert": "^0.1.0",
"debug": "^2.2.0",