1 | 1 | | use crate::{args, install, prompt}; |
2 | 2 | | |
| 3 | + | use ansi_term::{ |
| 4 | + | Color::{Purple, Red}, |
| 5 | + | Style, |
| 6 | + | }; |
3 | 7 | | use serde_json::Value; |
4 | 8 | | use std::collections::HashMap; |
5 | 9 | | use std::env; |
| skipped 165 lines |
171 | 175 | | |
172 | 176 | | if npm_script.is_some() { |
173 | 177 | | let script = npm_script.unwrap(); |
174 | | - | println!("> {}", script_name); |
175 | | - | println!("> {}{}", script, forwarded); |
| 178 | + | println!( |
| 179 | + | "{} {}", |
| 180 | + | Purple.dimmed().paint("$"), |
| 181 | + | Style::new().bold().dimmed().paint(script_name) |
| 182 | + | ); |
| 183 | + | println!( |
| 184 | + | "{} {}{}", |
| 185 | + | Purple.dimmed().paint("$"), |
| 186 | + | Style::new().bold().dimmed().paint(&script), |
| 187 | + | Style::new().bold().dimmed().paint(&forwarded), |
| 188 | + | ); |
176 | 189 | | let envs = HashMap::from([("PATH".to_string(), get_path_env(bin_dirs))]); |
177 | 190 | | run_command( |
178 | 191 | | &[&script, &forwarded], |
| skipped 21 lines |
200 | 213 | | return; |
201 | 214 | | } |
202 | 215 | | |
203 | | - | println!("No script found."); |
| 216 | + | // TODO: a custom logger module |
| 217 | + | println!("{}", Red.normal().paint("No script found.")); |
204 | 218 | | println!("To see a list of scripts, run `dum run`"); |
205 | 219 | | exit(1); |
206 | 220 | | } |
| skipped 1 lines |