Today, I was playing with Markdown in a README.md file for a repository and thought it’d be helpful if I could see my changes in real time (this was a junk repo I was going to delete, so I wasn’t worried about a bunch of commits). Just thought I’d blog this for my own future reference.
Create a script to commit changes and reload Safari…
Install fswatch (Mac’s version of inotifywait), a tool to monitor for changes to a file or folder.
brew install fswatch
With the following command, any change to our file will get committed and the page in Safari will be reloaded.
fswatch -o README.md | xargs -n1 ./update.sh