I'm using this Guardfile to watch .cpp and .h files and fire off make if anything changes. Works great as long as all files are in the directory the Guardfile is in.
guard 'shell' do
watch(%r{^\w*\.(h|cpp)$}) do
`make test`
end
end
I'd like to have the Guardfile in the root directory of my project tree and monitor the .h and .cpp files in each subdirectory. Is it possible to do that by changing the regex, or do I have to have a Guardfile in each subdirectory?
(Not sure why the formatting doesn't go through correctly)