mirror of
https://github.com/SrIzan10/nodemon.git
synced 2026-05-01 10:55:09 +00:00
@@ -5,7 +5,7 @@
|
||||
--config file ............ alternate nodemon.json config file to use
|
||||
-e, --ext ................ extensions to look for, ie. js,jade,hbs.
|
||||
-x, --exec app ........... execute script with "app", ie. -x "python -v".
|
||||
-w, --watch dir........... watch directory "dir" or files. use once for
|
||||
-w, --watch path.......... watch directory "path" or files. use once for
|
||||
each directory or file to watch.
|
||||
-i, --ignore ............. ignore specific files or directories.
|
||||
-V, --verbose ............ show detail on what is causing restarts.
|
||||
|
||||
@@ -160,7 +160,8 @@ function match(files, monitor, ext) {
|
||||
return '!**' + (prefix !== path.sep ? path.sep : '') + s.slice(1);
|
||||
}
|
||||
|
||||
if (s.slice(0, 2) === '..') {
|
||||
// if it starts with a period, then let's get the relative path
|
||||
if (s.indexOf('.') === 0) {
|
||||
return path.resolve(cwd, s);
|
||||
}
|
||||
|
||||
|
||||
@@ -557,4 +557,18 @@ describe('watcher', function() {
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
it('should watch relative paths', function() {
|
||||
const monitor = match.rulesToMonitor([ './http.js' ], [], {
|
||||
dirs: [],
|
||||
});
|
||||
|
||||
var matched = match(
|
||||
['http.js'],
|
||||
monitor,
|
||||
'js,mjs,json'
|
||||
);
|
||||
assert(matched.result.length === 1, 'found match ' + matched.results);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user