From 52b3da2597e93bfda85fc650948945855e8e771e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Vincent?= <28714795+leovct@users.noreply.github.com> Date: Mon, 21 Oct 2024 09:45:14 +0200 Subject: [PATCH] =?UTF-8?q?feat(`forge=20build`):=20`--watch`=20flag=20now?= =?UTF-8?q?=20watches=20`foundry.toml`=20config=E2=80=A6=20(#9148)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit feat(`forge build`): `--watch` flag now watches `foundry.toml` config changes --- crates/forge/bin/cmd/build.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/forge/bin/cmd/build.rs b/crates/forge/bin/cmd/build.rs index fefa76e465eb..f0fa7c9006e4 100644 --- a/crates/forge/bin/cmd/build.rs +++ b/crates/forge/bin/cmd/build.rs @@ -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 { - // 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] }) } }