Add terminal links

This commit is contained in:
mo8it
2024-04-14 02:41:19 +02:00
parent 5c0073a948
commit bee62c89de
10 changed files with 59 additions and 28 deletions
+9 -3
View File
@@ -17,18 +17,24 @@ pub fn run(app_state: &mut AppState) -> Result<()> {
if !output.status.success() {
app_state.set_pending(app_state.current_exercise_ind())?;
bail!("Ran {} with errors", app_state.current_exercise());
bail!(
"Ran {} with errors",
app_state.current_exercise().terminal_link(),
);
}
stdout.write_fmt(format_args!(
"{}{}\n",
"✓ Successfully ran ".green(),
exercise.path.to_string_lossy().green(),
exercise.path.green(),
))?;
match app_state.done_current_exercise(&mut stdout)? {
ExercisesProgress::AllDone => (),
ExercisesProgress::Pending => println!("Next exercise: {}", app_state.current_exercise()),
ExercisesProgress::Pending => println!(
"Next exercise: {}",
app_state.current_exercise().terminal_link(),
),
}
Ok(())