Projects STRLCPY dum Commits a5ea4458
🤬
  • fix: update log format for .bin scripts

  • Loading...
  • EGOIST committed 2 years ago
    a5ea4458
    1 parent 08fd4504
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■ ■
    src/run.rs
    skipped 101 lines
    102 102   .replace("yarn", dum)
    103 103  }
    104 104   
     105 +// Print the script name / script
     106 +fn print_script_info(script_name: &str, script: &str, forwarded: &str) {
     107 + println!(
     108 + "{} {}",
     109 + Purple.dimmed().paint("$"),
     110 + Style::new().bold().dimmed().paint(script_name)
     111 + );
     112 + println!(
     113 + "{} {}{}",
     114 + Purple.dimmed().paint("$"),
     115 + Style::new().bold().dimmed().paint(script),
     116 + Style::new().bold().dimmed().paint(forwarded),
     117 + );
     118 +}
     119 + 
    105 120  pub fn run(app_args: &args::AppArgs) {
    106 121   if args::COMMANDS_TO_FORWARD.contains(&app_args.command.as_str()) {
    107 122   debug!("Running command {}", app_args.command);
    skipped 101 lines
    209 224   });
    210 225   if npm_script.is_some() {
    211 226   let script = replace_run_commands(&npm_script.unwrap());
    212  - println!(
    213  - "{} {}",
    214  - Purple.dimmed().paint("$"),
    215  - Style::new().bold().dimmed().paint(script_name)
    216  - );
    217  - println!(
    218  - "{} {}{}",
    219  - Purple.dimmed().paint("$"),
    220  - Style::new().bold().dimmed().paint(&script),
    221  - Style::new().bold().dimmed().paint(&forwarded),
    222  - );
     227 + print_script_info(&script_name, &script, &forwarded);
    223 228   let envs = HashMap::from([("PATH".to_string(), get_path_env(bin_dirs))]);
    224 229   run_command(
    225 230   &[&script, &forwarded],
    skipped 7 lines
    233 238   let resolved_bin = resolve_bin_path(script_name.as_str(), &bin_dirs);
    234 239   if resolved_bin.is_some() {
    235 240   let bin_path = resolved_bin.unwrap();
    236  - println!("> {}", script_name);
    237  - println!("> {}{}", bin_path.to_str().unwrap(), forwarded);
     241 + print_script_info(&script_name, &bin_path.to_str().unwrap(), &forwarded);
    238 242   let envs = HashMap::from([("PATH".to_string(), get_path_env(bin_dirs))]);
    239 243   run_command(
    240 244   &[bin_path.to_str().unwrap(), &forwarded],
    skipped 14 lines
Please wait...
Page is in error, reload to recover