If you run any command via the --exec flag which does not exit (like a server), then --file-watch does not build again if the files changes.
I can understand why that is, and it is probably how the implementation is - but it is counter-intuitive.
Other dev tools (like gunicorn, go's reflex) works as expected. If a file changes, even with server like commands, it rebuilds/reloads and runs the commands again.
1.
stack build --fast --exec "sleep infinity" --file-watch
The build happens again, and the exec command is run again.
Nothing happens. (Because the exec command never exited)
$ stack --version
Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2
PS: There is an issue #2955 . But that is different than this issue.
Seems like a nice enhancement and also more intuitive - thanks for the suggestion @ecthiender .
Is this something you'd like to try and implement?
Sure, why not!
Maybe something like stack run --file-watch? That was the first thing I tried, similar to stack test --file-watch.
@ecthiender You wouldn't happen to have a update on this would you?

Most helpful comment