Skip to content

Commit

Permalink
feat(forge build): --watch flag now watches foundry.toml config…
Browse files Browse the repository at this point in the history
… changes
  • Loading branch information
leovct committed Oct 19, 2024
1 parent 9684c3d commit a0e2e02
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/forge/bin/cmd/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,12 @@ impl BuildArgs {
/// Returns the [`watchexec::InitConfig`] and [`watchexec::RuntimeConfig`] necessary to
/// bootstrap a new [`watchexe::Watchexec`] loop.
pub(crate) fn watchexec_config(&self) -> Result<watchexec::Config> {
// use the path arguments or if none where provided the `src` dir
// Use the path arguments or if none where provided the `src`, `test` and `script`
// directories as well as the `foundry.toml` configuration file.
self.watch.watchexec_config(|| {
let config = Config::from(self);
[config.src, config.test, config.script]
let foundry_toml: PathBuf = config.root.0.join(Config::FILE_NAME);
[config.src, config.test, config.script, foundry_toml]
})
}
}
Expand Down

0 comments on commit a0e2e02

Please sign in to comment.