Add a small timeout so the entire file will be written

This commit is contained in:
Dan Rosén 2018-02-28 10:06:57 +01:00
parent aed02b3e27
commit 9ac5a6bb12

View file

@ -215,7 +215,7 @@ function main() {
files.forEach(file => instrument(d, file))
if (opts.w == true || opts.watch == true) {
const watcher = chokidar.watch(files, {ignored: '*.doctest.*'})
watcher.on('change', file => instrument(d, file, 'watch'))
watcher.on('change', file => global.setTimeout(() => instrument(d, file, 'watch'), 25))
}
}