On Jul 25, 2007, at 3:00 PM, Allan Odgaard wrote:

On 25. Jul 2007, at 19:10, Gerd Knops wrote:

BTW find should ignore all files with the pattern ._*.h as well as any _darcs directory. This worked for me:

find "$TM_PROJECT_DIRECTORY" -type d \( -name _darcs \) -prune '!' -prune -o -name '*.h' '!' -name '._*'

That extra "'!' -prune" is to make the expression false, otherwise the _darcs directory name is printed. Oddly enough it is not required when I try find through the command line, but if I run it fo example using the 'Filter through command' textmate function, it is needed.

If you do not place an explicit -print in the expression, you may get the true branches printed.

Here’s my take:

find -E "$TM_PROJECT_DIRECTORY" -regex '.*/(_darcs|CVS|\..*)' - prune -or -name '*.h' -print

Ahh, learn something new every day, thanks! The above does not ignore those pesky ._*.h files though (resource-fork on NFS file systems), this would:

find -E "$TM_PROJECT_DIRECTORY" -regex '.*/(_darcs|CVS|\..*)' -prune -or -name '*.h' \! -name '._*' -print

Gerd


_______________________________________________
textmate-dev mailing list
[email protected]
http://lists.macromates.com/mailman/listinfo/textmate-dev

Reply via email to