joh / when-changed

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

Can we watch only certain filetypes? #90

Open cgebbe opened 2 years ago

cgebbe commented 2 years ago

I try to use this as a replacement for pytest-watch, which is not maintained anymore.

This works beautifully: when-changed -s -r tests/ -c echo "hello"

However, I would like to watch only files with the PY extension like such: when-changed -s 'tests/**/*.py' -c echo "hello" which results in the following error using git bash on windows

OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect.

Also, I tried to use find tests/ -name '*.py' | xargs -I{} when-changed {} -c echo "hello" , but this doesn't work and I can't even exit from it.