From 47fab6809a1e23b3b9a84695e2d91ff0826ba79a Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Mon, 25 Jul 2022 13:51:04 -0300 Subject: [PATCH] fix(cli): dev watcher incorrectly killing process on multiple file write (#4684) --- .changes/fix-watcher.md | 6 ++++++ tooling/cli/src/interface/rust.rs | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .changes/fix-watcher.md diff --git a/.changes/fix-watcher.md b/.changes/fix-watcher.md new file mode 100644 index 000000000..6f63cfd56 --- /dev/null +++ b/.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. diff --git a/tooling/cli/src/interface/rust.rs b/tooling/cli/src/interface/rust.rs index 958a39ece..1765dd302 100644 --- a/tooling/cli/src/interface/rust.rs +++ b/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 + }, + ); } })?;