Command line file watch
My scenario is that I would like to do some tasks or commands if a file in the directory changed. I have come across this little command (fswatch) which saved me lots of development time.
Get jay the dev’s stories in your inbox
Join Medium for free to get updates from this writer.
Here is the command which helped me a lot
fswatch -d <directory> | (while read; do <command>; done)
Just replace the directory and the command to execute in the above command. I have tired only in mac but as per the docs it would support other platforms also
Here you could find documentation regarding the fswatch https://github.com/emcrisostomo/fswatch




