joh / when-changed

Execute a command when a file is changed
Other
1.21k stars 107 forks source link

Command runs twice #59

Closed vacovnik closed 5 years ago

vacovnik commented 7 years ago

Hi! Thank you for a good work so far!

I have an issue though... I'm running Ubuntu 16.04 and when-changed sometimes executes my command two times when run like so:

when-changed * -c ./pushGit.sh

pushGit.sh:

!/bin/bash

git commit -am 'save' git push

Thanks again and have a nice day!

joh commented 7 years ago

Some files are probably modified due to the git commit. Can you try when-changed -1 ... ?

joh commented 7 years ago

Also, -v should give you some more information about which files were modified.

vacovnik commented 7 years ago

Oh.... Next time I'll try to read manual before asking... Thanks for your reply! By the way, -v does not print out changed file for me... It prints some fancy text with all files it is watching, but nothing after that.