When working on small scripts, or writing a document that I want converted to a different format, Ill sometimes use a program that will watch for file changes, and run a command for me automatically. Ill usually use this command to run the script to check its output, or have it convert the document so it refreshes live.

Without going too deep into all of the arguments, theres 2 main ones:

-p "{regex}: Regex that will trigger the build command.

-r "{build cmd}": The build command that is to be run on each file change.

watchman-make -p "{regex}" -r "{build cmd}"

Example: Convert my markdown file to pdf.

watchman-make -p "*.md" -r "pandoc -i TODO -o TODO"