|
| 1 | +use std::env; |
1 | 2 | use crate::exercise::{CompiledExercise, Exercise, Mode, State}; |
2 | 3 | use console::style; |
3 | 4 | use indicatif::ProgressBar; |
@@ -137,14 +138,24 @@ fn prompt_for_completion(exercise: &Exercise, prompt_output: Option<String>) -> |
137 | 138 | State::Pending(context) => context, |
138 | 139 | }; |
139 | 140 |
|
| 141 | + let no_emoji = env::var("NO_EMOJI").is_ok(); |
| 142 | + |
| 143 | + let clippy_success_msg = match no_emoji { |
| 144 | + true => "The code is compiling, and Clippy is happy!", |
| 145 | + false => "The code is compiling, and 📎 Clippy 📎 is happy!" |
| 146 | + }; |
| 147 | + |
140 | 148 | let success_msg = match exercise.mode { |
141 | 149 | Mode::Compile => "The code is compiling!", |
142 | 150 | Mode::Test => "The code is compiling, and the tests pass!", |
143 | | - Mode::Clippy => "The code is compiling, and 📎 Clippy 📎 is happy!", |
| 151 | + Mode::Clippy => clippy_success_msg, |
144 | 152 | }; |
145 | 153 |
|
146 | 154 | println!(); |
147 | | - println!("🎉 🎉 {} 🎉 🎉", success_msg); |
| 155 | + match no_emoji { |
| 156 | + true => println!("~*~ {} ~*~", success_msg), |
| 157 | + false => println!("🎉 🎉 {} 🎉 🎉", success_msg) |
| 158 | + }; |
148 | 159 | println!(); |
149 | 160 |
|
150 | 161 | if let Some(output) = prompt_output { |
|
0 commit comments