Get ack to exclude files of type ".min.js"

I minimize javascript files on the fly and create a .min.js file next to an existing file. This is a problem, though, when using ack, since it treats them as .js files and searches for them, clogging the results screen with miniature javascript.

I tried adding this to my .ackrc with no luck:

--type-set=minjs=.min.js --nominjs 

Is there a way to make ack ignore this type of extension?

PS I have no way to simply rename .min.js to .min_js or any other options.

+7
source share
2 answers

It looks like a limitation in App :: Ack :: filetypes.

Regular expression:

 if ( $filename =~ m{\.([^\.$dir_sep_chars]+)$}o ) { 

It "." it will be blocked from matching anything previous.

+5
source

Ack ignores min.js files since version 1.96 , so a simple update will do the trick.

No need to customize. By default ignored.

+4
source

All Articles