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
foundry-rs#9148)

feat(`forge build`): `--watch` flag now watches `foundry.toml` config changes
  • Loading branch information
leovct authored and rplusq committed Nov 29, 2024
1 parent 8266cfb commit 9024d7a
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 9024d7a

Please sign in to comment.