diff options
| author | Mo <76752051+mo8it@users.noreply.github.com> | 2024-10-14 01:29:25 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-14 01:29:25 +0200 |
| commit | baeeff389c95ba145e3383ec1f1357e078d0bbca (patch) | |
| tree | 4d3157197acaf9705c5d1da17b3e6c5c28dc495b /src/run.rs | |
| parent | 84a42a2b24687ed11f4d2a5c9b624d00b74de916 (diff) | |
| parent | 932bc25d8824e18debc91e5f25f022e8d066bcf8 (diff) | |
Merge pull request #2122 from Nahor/check_all
Improvement to "check all exercises"
Diffstat (limited to 'src/run.rs')
| -rw-r--r-- | src/run.rs | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -5,7 +5,7 @@ use crossterm::{ }; use std::{ io::{self, Write}, - process::exit, + process::ExitCode, }; use crate::{ @@ -13,7 +13,7 @@ use crate::{ exercise::{solution_link_line, RunnableExercise, OUTPUT_CAPACITY}, }; -pub fn run(app_state: &mut AppState) -> Result<()> { +pub fn run(app_state: &mut AppState) -> Result<ExitCode> { let exercise = app_state.current_exercise(); let mut output = Vec::with_capacity(OUTPUT_CAPACITY); let success = exercise.run_exercise(Some(&mut output), app_state.cmd_runner())?; @@ -29,7 +29,8 @@ pub fn run(app_state: &mut AppState) -> Result<()> { .current_exercise() .terminal_file_link(&mut stdout)?; stdout.write_all(b" with errors\n")?; - exit(1); + + return Ok(ExitCode::FAILURE); } stdout.queue(SetForegroundColor(Color::Green))?; @@ -55,5 +56,5 @@ pub fn run(app_state: &mut AppState) -> Result<()> { ExercisesProgress::AllDone => (), } - Ok(()) + Ok(ExitCode::SUCCESS) } |
