Skip to content

Commit

Permalink
Issue #8664 | Bug 🐛: --match-path does not work with watch mode: cann…
Browse files Browse the repository at this point in the history
…ot be used multiple times #8664 (#8709)

* Issue #8664 | Bug 🐛: --match-path does not work with watch mode: cannot be used multiple times #8664

* reuse _no_reconfigure var

* Remove undescore var name and also remove no needed extra lines

* fmt

---------

Co-authored-by: Arsenii Kulikov <[email protected]>
  • Loading branch information
PabloVillaplana and klkvr authored Aug 21, 2024
1 parent 503fbee commit fa0e0c2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/forge/bin/cmd/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ pub async fn watch_test(args: TestArgs) -> Result<()> {
let config: Config = args.build_args().into();
let filter = args.filter(&config);
// Marker to check whether to override the command.
let _no_reconfigure = filter.args().test_pattern.is_some() ||
let no_reconfigure = filter.args().test_pattern.is_some() ||
filter.args().path_pattern.is_some() ||
filter.args().contract_pattern.is_some() ||
args.watch.run_all;
Expand Down Expand Up @@ -303,7 +303,10 @@ pub async fn watch_test(args: TestArgs) -> Result<()> {

trace!(?file, "reconfigure test command");

command.arg("--match-path").arg(&file);
// Before appending `--match-path`, check if it already exists
if !no_reconfigure {
command.arg("--match-path").arg(file);
}
},
)?;
run(config).await?;
Expand Down

0 comments on commit fa0e0c2

Please sign in to comment.