Is it possible to use ack to search for content within Smarty template files (.tpl)?
At the moment I can only search within the cached version of these templates, which themselves are PHP files.
If I do a case-insensitive ack search like this below this is what is returned:
[crmpicco@dev dev_crmpicco]$ ack -i select\ the\ course
cache/templates/gb/%%9B^9B3^9B37B147%%course.tpl.php
48: <p><label>Select the course:</label></p>
64: <p><label>Select the course:</label></p>
83: <p><label>Select the course:</label></p>
It sounds like what you’re asking is “How do I get ack 1.x to recognize .tpl as a valid filetype?”
What you want is to put
--type-set=smarty=.tplon the command line or in the ACK_OPTIONS environment variable or in your .ackrc file. Then you can say things like “ack –smarty foo” and it will only search smarty files.You probably also want to use
--ignore-dir=cacheso ack doesn’t search in your cache directory.Case sensitivity is unrelated to the issues here.