From 86202b4d54a8158a9629aabbcdf557ec4bc5fc13 Mon Sep 17 00:00:00 2001 From: Jiajie Chen Date: Wed, 19 Jun 2024 17:33:07 +0800 Subject: [PATCH] feat: convert \r\n, \r to \n --- worker/src/build.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/worker/src/build.rs b/worker/src/build.rs index 21f3594..9b3c5c2 100644 --- a/worker/src/build.rs +++ b/worker/src/build.rs @@ -52,7 +52,9 @@ async fn get_output_logged( let mut stdout_out = vec![]; while let Ok(Some(v)) = stdout_reader.next_line().await { - tx.clone().into_send_async(Message::Text(v.clone())).await?; + tx.clone() + .into_send_async(Message::Text(v.replace("\r\n", "\n").replace("\r", "\n"))) + .await?; stdout_out.push(v); } @@ -70,7 +72,7 @@ async fn get_output_logged( ) .as_bytes(), ); - logs.extend("STDOUT/ERR:\n".as_bytes()); + logs.extend("STDOUT&STDERR:\n".as_bytes()); logs.extend(stdout_out.join("\n").as_bytes()); Ok(output)