Merge branch 'master' into master

This commit is contained in:
YuKun Liu authored and GitHub committed 2022-09-25 13:55:46 +08:00
commit 52e8d9f357
1 file changed
+13 -15
+13 -15
View File
@@ -194,8 +194,8 @@ pub async fn startup_hot_reload(port: u16, config: CrateConfig) -> Result<()> {
} }
} }
} }
if !messages.is_empty() { if updated {
let _ = hot_reload_tx.send(SetManyRsxMessage(messages)); last_update_time = chrono::Local::now().timestamp();
} }
} }
last_update_time = chrono::Local::now().timestamp(); last_update_time = chrono::Local::now().timestamp();
@@ -427,19 +427,17 @@ pub struct PrettierOptions {
} }
fn print_console_info(port: u16, config: &CrateConfig, options: PrettierOptions) { fn print_console_info(port: u16, config: &CrateConfig, options: PrettierOptions) {
print!( if let Ok(native_clearseq) = Command::new(if cfg!(target_os = "windows") {
"{}", "cls"
String::from_utf8_lossy( } else {
&Command::new(if cfg!(target_os = "windows") { "clear"
"cls" })
} else { .output() {
"clear" print!("{}", String::from_utf8_lossy(&native_clearseq.stdout));
}) } else {
.output() // Try ANSI-Escape characters
.unwrap() print!("\x1b[2J\x1b[H");
.stdout }
)
);
// for path in &changed { // for path in &changed {
// let path = path // let path = path