开发者

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

I minify javascript files on the fly and produce a .min.js file beside the existing file. This i开发者_高级运维s a problem though when using ack as it treats these as .js files and searches them littering my results screen with minified javascript.

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

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

Is there any way to get ack to ignore this type of extension?

PS I do not have the option of simply renaming .min.js to .min_js or any other variation.


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

The regular expression is:

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

That "." in there is going to block from matching anything previous.


Ack ignores min.js files as of version 1.96, so a simple upgrade will do the trick.

There is no option you need to set. The ignoring happens by default.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜