node.js - ack|grep|whatnot special ignore folders pattern node_modules/dir/node_modules -
i have discovered ack , ack -ir --ignore-dir={node_modules,dist,.git} <search-term>
works great things
---node_modules/ ---------------project1/ -----------------------node_modules/ ---------------project2/ -----------------------node_modules/
i search files under "root" node_modules , excluding internal ones.
note: if run find . -type f | ack -v 'node_modules|.git|dist'
under root node_modules folder, proper file list. happen because find .
gives out relative paths. way feed list ack ?
ack -i <search-term> ./node_modules/*
should want. if want include hidden files , folders too, set shopt -s dotglob
(assumes bash) first.
background information:
ack
has many rules ignoring files don't typically want search built in.
as of @ least version 2.14, includes directories named .git
, node_modules
, @ whatever level of hierarchy (ack
searches recursively default, though may add -r
/ -r
/ --recursive
make explicit).
see complete list of directories / files ignored default, run ack --dump
.
by using globbing (pathname expansion) let shell expand pattern ./node_modules/*
list of actual items inside ./node_modules
, ignore rule node_modules
bypassed explicitly passed items.
Comments
Post a Comment