Skip to content

Commit 360bcad

Browse files
fix: prevent crash when removing a file
1 parent b9541e4 commit 360bcad

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

packages/serinus_cli/lib/src/commands/run/run_command.dart

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,17 @@ class RunCommand extends Command<int> {
107107
_watcher.events.where((_) => _developmentMode).listen((event) async {
108108
final shouldRestart = event.path.endsWith('.dart') &&
109109
(event.type == ChangeType.REMOVE ||
110-
watcherPaths.any((path) {
111-
final entity = FileSystemEntity.isDirectorySync(path)
112-
? Directory(path)
113-
: File(path);
114-
return entity.existsSync() &&
115-
File(event.path).existsSync() &&
116-
FileSystemEntity.identicalSync(
117-
event.path,
118-
entity.absolute.path,
119-
);
120-
}));
110+
watcherPaths.any((path) {
111+
final entity = FileSystemEntity.isDirectorySync(path)
112+
? Directory(path)
113+
: File(path);
114+
return entity.existsSync() &&
115+
File(event.path).existsSync() &&
116+
FileSystemEntity.identicalSync(
117+
event.path,
118+
entity.absolute.path,
119+
);
120+
}));
121121
if (!shouldRestart) {
122122
return;
123123
}

0 commit comments

Comments
 (0)