diff options
| author | mo8it <mo8it@proton.me> | 2024-10-13 22:02:41 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-10-13 22:02:41 +0200 |
| commit | 326169a7fabacda9a21377b110371f91b32e8fd3 (patch) | |
| tree | 6cbdabd99a886d3c0d203640aae671bfe036fd1b /src/run.rs | |
| parent | 685e069c58ef02dae65381974722315ee8c84e8b (diff) | |
Improve check-all command
Diffstat (limited to 'src/run.rs')
| -rw-r--r-- | src/run.rs | 8 |
1 files changed, 4 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,7 @@ 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 +55,5 @@ pub fn run(app_state: &mut AppState) -> Result<()> { ExercisesProgress::AllDone => (), } - Ok(()) + Ok(ExitCode::SUCCESS) } |
