Projects STRLCPY dum Commits 895bd6b2
🤬
  • stop replacing `npm run` in npmscripts

  • Loading...
  • EGOIST committed 2 years ago
    895bd6b2
    1 parent 134b2ca4
  • ■ ■ ■ ■ ■ ■
    src/run.rs
    skipped 84 lines
    85 85   None
    86 86  }
    87 87   
    88  -// Replace npm run / yarn / pnpm run with `dum`
    89  -fn replace_run_commands(script: &str) -> String {
    90  - let mut dum = "dum";
    91  - let mut dum_run = "dum run";
    92  - if cfg!(debug_assertions) {
    93  - dum = "target/debug/dum";
    94  - dum_run = "target/debug/dum run";
    95  - }
    96  - script
    97  - .replace("npm run", dum_run)
    98  - .replace("yarn run", dum_run)
    99  - .replace("pnpm run", dum_run)
    100  - .replace("npx", dum)
    101  - .replace("pnpx", dum)
    102  - .replace("yarn", dum)
    103  -}
    104  - 
    105 88  // Print the script name / script
    106 89  fn print_script_info(script_name: &str, script: &str, forwarded: &str) {
    107 90   println!(
    skipped 123 lines
    231 214   script.unwrap_or_default()
    232 215   });
    233 216   if let Some(script) = npm_script {
    234  - let script = replace_run_commands(&script);
    235 217   print_script_info(&script_name, &script, &forwarded);
    236 218   let envs = HashMap::from([("PATH".to_string(), get_path_env(bin_dirs))]);
    237 219   run_command(
    skipped 28 lines
Please wait...
Page is in error, reload to recover