Closed etiennebacher closed 3 years ago
The handler should be a function. What you provided is a call, not a function.
servr::httw(
"docs/site",
handler = function(files) {
system("cd docs && mkdocs build -q")
}
)
In the future, you may consider asking questions on Stack Overflow or RStudio Community: https://yihui.org/issue/ Thank you!
Hello, I want to run a command each time a file is changed but before
httw()
serves the files. I think the argumenthandler
should be appropriate for that but I don't understand the second part of its description: "a function to be called every time any files are changed or added under the directory; its argument is a character vector of the filenames of the files modified or added".So far, I'm doing something like:
This doesn't work and I couldn't find any example in the docs or online. Could you give an example of how to use it?
Thanks in advance