diff --git a/src/main.rs b/src/main.rs index 654a2676..33b65fc3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2007,8 +2007,13 @@ fn main() -> Result<()> { playwright_cmd::run(&args[1..], cli.verbose)?; } _ => { - // Generic passthrough with npm boilerplate filter - npm_cmd::run(&args, cli.verbose, cli.skip_env)?; + let status = utils::resolved_command("npx") + .args(&args) + .status() + .context("Failed to run npx")?; + if !status.success() { + std::process::exit(status.code().unwrap_or(1)); + } } } } @@ -2633,4 +2638,17 @@ mod tests { } } } + + #[test] + fn test_npx_passthrough_preserves_all_args() { + let cli = + Cli::try_parse_from(["rtk", "npx", "cowsay", "-f", "tux", "hello"]) + .unwrap(); + match cli.command { + Commands::Npx { args } => { + assert_eq!(args, vec!["cowsay", "-f", "tux", "hello"]); + } + _ => panic!("Expected Npx command"), + } + } }