Projects STRLCPY dum Commits 4dbdd005
🤬
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■ ■
    Cargo.lock
    skipped 2 lines
    3 3  version = 3
    4 4   
    5 5  [[package]]
     6 +name = "ansi_term"
     7 +version = "0.12.1"
     8 +source = "registry+https://github.com/rust-lang/crates.io-index"
     9 +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
     10 +dependencies = [
     11 + "winapi",
     12 +]
     13 + 
     14 +[[package]]
    6 15  name = "bitflags"
    7 16  version = "1.3.2"
    8 17  source = "registry+https://github.com/rust-lang/crates.io-index"
    skipped 36 lines
    45 54  name = "dum"
    46 55  version = "0.1.12"
    47 56  dependencies = [
     57 + "ansi_term",
    48 58   "dialoguer",
    49 59   "serde_json",
    50 60  ]
    skipped 208 lines
  • ■ ■ ■ ■
    Cargo.toml
    skipped 11 lines
    12 12  [dependencies]
    13 13  serde_json = "1.0"
    14 14  dialoguer = "0.9.0"
    15  - 
     15 +ansi_term = "0.12.1"
  • ■ ■ ■ ■ ■
    src/run.rs
    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
Please wait...
Page is in error, reload to recover