I work with Haskell stack and found the --file-watch
opton, but was then surprised that it works for build
but not for run
. Searching on the web indicates that there are some ways to achieve the effects of stack run --file-watch
with other commands (script
?), but I could not find a simple, straightforward solution. Is there one?
how to achieve `stack run --file-watch`
Asked Answered
Use --exec COMMAND [ARGUMENT(S)]
for stack build
From stack build --help
:
--exec COMMAND [ARGUMENT(S)]
Command and argument(s) to run after a successful build
So, finally
stack build --file-watch --exec COMMAND
The name of executable file is specified in package.yaml (or .cabal)
© 2022 - 2024 — McMap. All rights reserved.