Like node-watch but only run when things change when using
npm install git-watch
const gitWatch =
null unless git errors, e.g. not a git repo
fileName is the name of the file which has changed
watchEvent see node-watch but things like
gitStatus is the response from
You can even use this from the command line
git-watch --dir=./ --cmd="npm test --filter=$1"
$1 with the file which has changed
--dir | -d is the directory to watch, defaults to process.cwd() --cmd | -c is the command to run, will append the file name to the end of the cmd or replaces all $1 with the file which has changed --help | -h to get some sort of help message
if you don't want to execute then just stick a
# on the end e.g.
npm test # because
# is just a comment right?