diff --git a/packages/perseus-cli/src/cmd.rs b/packages/perseus-cli/src/cmd.rs index 177e3aa95d..2d8c63afda 100644 --- a/packages/perseus-cli/src/cmd.rs +++ b/packages/perseus-cli/src/cmd.rs @@ -39,9 +39,11 @@ pub fn run_cmd( None => 1, // If we don't know an exit code but we know that the command failed, return 1 (general error code) }; - // Print `stderr` only if there's something therein and the exit code is non-zero + // Print `stderr` and `stdout` only if there's something therein and the exit code is non-zero + // If we only print `stderr`, we can miss some things (see #74) if !output.stderr.is_empty() && exit_code != 0 { pre_dump(); + std::io::stderr().write_all(&output.stdout).unwrap(); std::io::stderr().write_all(&output.stderr).unwrap(); } diff --git a/packages/perseus-cli/src/serve.rs b/packages/perseus-cli/src/serve.rs index f85dad203a..78f0582a04 100644 --- a/packages/perseus-cli/src/serve.rs +++ b/packages/perseus-cli/src/serve.rs @@ -165,9 +165,10 @@ fn run_server( None if output.status.success() => 0, // If we don't, but we know the command succeeded, return 0 (success code) None => 1, // If we don't know an exit code but we know that the command failed, return 1 (general error code) }; - // Print `stderr` only if there's something therein and the exit code is non-zero + // Print `stderr` and stdout` only if there's something therein and the exit code is non-zero if !output.stderr.is_empty() && exit_code != 0 { // We don't print any failure message other than the actual error right now (see if people want something else?) + std::io::stderr().write_all(&output.stdout).unwrap(); std::io::stderr().write_all(&output.stderr).unwrap(); return Ok(1); }