Skip to content

Commit

Permalink
Windows fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zakstucke committed Jan 26, 2024
1 parent 75c7cea commit b6600ee
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions rust/bitbazaar/cli/bash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,19 @@ pub struct Shell {

impl From<Shell> for CmdOut {
fn from(val: Shell) -> Self {
CmdOut {
stdout: val.stdout,
stderr: val.stderr,
code: val.code,
if cfg!(windows) {
// Remove carriage returns from newlines in windows:
CmdOut {
stdout: val.stdout.replace("\r\n", "\n"),
stderr: val.stderr.replace("\r\n", "\n"),
code: val.code,
}
} else {
CmdOut {
stdout: val.stdout,
stderr: val.stderr,
code: val.code,
}
}
}
}
Expand Down

0 comments on commit b6600ee

Please sign in to comment.