| Index: pkg/watcher/lib/src/directory_watcher/linux.dart
|
| diff --git a/pkg/watcher/lib/src/directory_watcher/linux.dart b/pkg/watcher/lib/src/directory_watcher/linux.dart
|
| index 5e86a43444a03ad24a3a0ce4a259de21cc6e9d5c..76558dd2795e2bf8e61687746191eacdbc74d517 100644
|
| --- a/pkg/watcher/lib/src/directory_watcher/linux.dart
|
| +++ b/pkg/watcher/lib/src/directory_watcher/linux.dart
|
| @@ -7,6 +7,8 @@ library watcher.directory_watcher.linux;
|
| import 'dart:async';
|
| import 'dart:io';
|
|
|
| +import 'package:stack_trace/stack_trace.dart';
|
| +
|
| import '../utils.dart';
|
| import '../watch_event.dart';
|
| import 'resubscribable.dart';
|
| @@ -56,13 +58,13 @@ class _LinuxDirectoryWatcher implements ManuallyClosedDirectoryWatcher {
|
| _LinuxDirectoryWatcher(String directory)
|
| : directory = directory {
|
| // Batch the inotify changes together so that we can dedup events.
|
| - var innerStream = new Directory(directory).watch().transform(
|
| - new BatchedStreamTransformer<FileSystemEvent>());
|
| + var innerStream = Chain.track(new Directory(directory).watch())
|
| + .transform(new BatchedStreamTransformer<FileSystemEvent>());
|
| _listen(innerStream, _onBatch,
|
| onError: _eventsController.addError,
|
| onDone: _onDone);
|
|
|
| - _listen(new Directory(directory).list(), (entity) {
|
| + _listen(Chain.track(new Directory(directory).list()), (entity) {
|
| _entries[entity.path] = new _EntryState(entity is Directory);
|
| if (entity is! Directory) return;
|
| _watchSubdir(entity.path);
|
| @@ -157,7 +159,7 @@ class _LinuxDirectoryWatcher implements ManuallyClosedDirectoryWatcher {
|
| // event for every new file.
|
| watcher.ready.then((_) {
|
| if (!isReady || _eventsController.isClosed) return;
|
| - _listen(new Directory(path).list(recursive: true), (entry) {
|
| + _listen(Chain.track(new Directory(path).list(recursive: true)), (entry) {
|
| if (entry is Directory) return;
|
| _eventsController.add(new WatchEvent(ChangeType.ADD, entry.path));
|
| }, onError: (error, stackTrace) {
|
|
|