-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
forge script --watch
is not watching anything
#4476
Comments
What if you explicitly specify the script dir, e.g. |
Same behavior. Since it's stayed in the docs I wanted to leverage on that. Thus it's either about removing the |
I don't think there's much value in having a watch mode for scripts, because in many cases it won't work anyway (e.g. create2 deployments), so my preference would be to fix the docs/CLI help |
@mds1 Why won't it work sorry? Wouldn't you pass the I do understand however that shipping such a feature could be a hard task. But from the perspective of DX, I would find it really useful to build a custom script that watches the changes in the smart contracts, and automatically deploys the contracts locally with Since Let's reference back to this issue if similar feature requests are opened in the future to be considered needed. I'm good with changing the docs for now. |
If you pass a salt to the script, in watch mode it's always going to use the same salt, meaning it will deploy to the same address, and since there's already code there from the first deploy, the deploy would fail. So you'd have to restart anvil in between / clear the code from that address But otherwise sounds good, I'll leave this issue open until CLI help/docs are updated |
the only reason --watch is in there is because of code debt, some argument types used by
this sounds like a valid usecase. |
Yes, it would be possible only if But isn't a local development node running when |
Unlike hardhat, |
Well, then it's certain that the |
Just reviewed the above: summary seems to be that the action here is to fix the |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (28b2ae6 2023-03-04T00:10:50.272293Z)
What command(s) is the bug in?
forg escript
Operating System
macOS (Intel)
Describe the bug
Greetings folks!
Have a specific use-case where I need to watch-on-file changes and redeploy the script to the anvil (trying to make recompile on-watch along with
@wagmi/cli
hooks work), but it just looks like the --watch mode does ... nothing?2023-03-04.21.26.30.mp4
The text was updated successfully, but these errors were encountered: