fix(xtask): remove the test_flags arg if it's empty for cargo test
`cargo xtask test test_something` currently constructs `cargo test '' test_something`, which errors out for `cargo test`. This fix removes the `test_flags` string if it's empty.
This commit is contained in:
parent
0f15779863
commit
20aaabfd9c
1 changed files with 5 additions and 1 deletions
|
|
@ -86,7 +86,11 @@ pub fn run(args: &Test) -> Result<()> {
|
|||
)?;
|
||||
} else {
|
||||
let mut cargo_cmd = Command::new("cargo");
|
||||
cargo_cmd.arg("test").arg(test_flags).args(&args.args);
|
||||
cargo_cmd.arg("test");
|
||||
if !test_flags.is_empty() {
|
||||
cargo_cmd.arg(test_flags);
|
||||
}
|
||||
cargo_cmd.args(&args.args);
|
||||
if args.nocapture {
|
||||
cargo_cmd.arg("--").arg("--nocapture");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue