I am using this command to watch a directory:
inotifywait -r -e modify,create,delete --exclude ".*(\.(git|idea)|(.*(___jb_tmp___|___jb_old___)))" my-dir
However, it does not work like I intend. What I want is that it does only NOT fire if every file that was changed is excluded. If there is at least one file that is NOT excluded and changes, then I want inotifywait to "fire".
My overall plan is to push code to a remove server whenever a python file or something else that is relevant is changed. I do not want to push code when only meta files from my IDE (PyCharm) or git files are changed.
Is there a way to do this?
Right now inotifywait does not fire when I change a python file in PyCharm since there are some files changed that end with _jb_tmp_. However, if I change a python file by hand, it works (e.g. in nano or vim).