Skip to content

Commit

Permalink
feat: convert \r\n, \r to \n
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegec committed Jun 19, 2024
1 parent d3086e8 commit 86202b4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions worker/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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)
Expand Down

0 comments on commit 86202b4

Please sign in to comment.