Переглянути джерело

fix(cli): dev watcher incorrectly killing process on multiple file write (#4684)

Lucas Fernandes Nogueira 3 роки тому
батько
коміт
47fab6809a
2 змінених файлів з 14 додано та 1 видалено
  1. 6 0
      .changes/fix-watcher.md
  2. 8 1
      tooling/cli/src/interface/rust.rs

+ 6 - 0
.changes/fix-watcher.md

@@ -0,0 +1,6 @@
+---
+"cli.rs": patch
+"cli.js": patch
+---
+
+Fixes dev watcher incorrectly exiting the CLI when sequential file updates are detected.

+ 8 - 1
tooling/cli/src/interface/rust.rs

@@ -358,7 +358,14 @@ impl Rust {
 
         app_child_.lock().unwrap().replace(app_child);
       } else {
-        on_exit(status, reason);
+        on_exit(
+          status,
+          if manually_killed_app_.load(Ordering::Relaxed) {
+            ExitReason::TriggeredKill
+          } else {
+            reason
+          },
+        );
       }
     })?;