summaryrefslogtreecommitdiff
path: root/src/watch
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-04-09 22:20:12 +0200
committermo8it <mo8it@proton.me>2024-04-09 22:20:12 +0200
commitc8d217ad50a7117fe35735b4083f2aa1e2b47d97 (patch)
treeb60fd7dd213507526115df58e37a51b320b9599a /src/watch
parenta8ddc07a9aea5b2e3840a7b6e0eb20f2189bdd60 (diff)
Fix showing stdout and stderr
Diffstat (limited to 'src/watch')
-rw-r--r--src/watch/state.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/watch/state.rs b/src/watch/state.rs
index 8fae7e8..24978bb 100644
--- a/src/watch/state.rs
+++ b/src/watch/state.rs
@@ -60,13 +60,15 @@ impl<'a> WatchState<'a> {
pub fn run_exercise(&mut self) -> Result<bool> {
let output = self.exercise.run()?;
+ self.stdout = Some(output.stdout);
if !output.status.success() {
- self.stdout = Some(output.stdout);
self.stderr = Some(output.stderr);
return Ok(false);
}
+ self.stderr = None;
+
if let State::Pending(context) = self.exercise.state()? {
let mut message = format!(
"
@@ -98,7 +100,6 @@ You can keep working on this exercise or jump into the next one by removing the
)?;
}
- self.stdout = Some(output.stdout);
self.message = Some(message);
return Ok(false);
}