fix: fixed an issue where we tried to resolve null as path

This commit is contained in:
Martin Dimitrov
2017-12-15 14:31:17 +02:00
committed by Remy Sharp
parent 14fcf94404
commit 10ded94cd7

View File

@@ -142,18 +142,20 @@ function filterAndRestart(files) {
// if there's no matches, then test to see if the changed file is the
// running script, if so, let's allow a restart
const script = path.resolve(config.options.execOptions.script);
if (matched.result.length === 0 && script) {
const length = script.length;
files.find(file => {
if (file.substr(-length, length) === script) {
matched = {
result: [ file ],
total: 1,
if (config.options.execOptions.script) {
const script = path.resolve(config.options.execOptions.script);
if (matched.result.length === 0 && script) {
const length = script.length;
files.find(file => {
if (file.substr(-length, length) === script) {
matched = {
result: [ file ],
total: 1,
}
return true;
}
return true;
}
})
})
}
}
utils.log.detail('changes after filters (before/after): ' +